WebApp Sec mailing list archives

Cookies sent to different ports?


From: CFW <cfw_security () comcast net>
Date: Tue, 14 Dec 2004 15:24:14 -0500

Hello all,

  I have an observation about cookie behavior.  Scenario:

- a user goes to a web server running at http://host:12345/,
- host:12345 responds with a Set-Cookie: ... , PATH=/
- user/browser goes to http://host:54321/ (same host as above)

  Should the browser send the cookie with the GET of http://host:54321/?

My answer would be no, it should not since host:54321 is a different server (meaning process at least). However, I have checked this with both IE and Firefox and they happily send the cookie along. Someone (thanks Matt) looked in to this for me a little and it turns out that this is required by the RFC, cookies are tied to host and protocol (HTTP or HTTPS, though I think this is only sometime true through use of the "secure" cookie tag), not to port. It would seem that this may have some implications in shared hosting environments, but usually those will be separate hostnames (even if they reside on the same IP). There are also cases where a team may have multiple "test" servers up on different posts of the same host, so this issue could come out there as well.

  Any thoughts?  Thanks.

Chuck


Current thread: