When you set a cookie, you set raw cookie data and some metadata. This metadata includes the path for the cookie, the expiration time of the cookie, etc.
When the browser executes the request, what exactly will the browsers send with it? Will it send a full cookie with all the "metadata"? Or just actual cookie data without metadata?
In subsequent requests, only the cookie value is returned, the remaining metadata remains on the client.
cookie , Set-Cookie , , cookie. Set-Cookie.
Set-Cookie
, "" cookie, , cookie . Cookie , / cookie.
Cookie
cookie , , cookie . , cookie.
cookie "Set-Cookie". ( ), . () cookie "Cookie".
Firebug - Firefox. .
cookie , , cookie
- , , cookie RFC2965 ( Set-Cookie2), . :
Set-Cookie2
Cookie: $Version="1"; name="val"; $Path="/site"; $Domain=".example.com"; $Port="81"; name="val"; $Path="/site/dir"; $Domain=".example.com"; $Port="81"
if the cookie was specified using the original netscape header Set-Cookie, no attributes will be retransmitted. if multiple cookies with the same name (but in different ways) are valid for the request, all relevant cookies will be provided. request example:
Cookie: name=val; name=val2
full specification here:
http://tools.ietf.org/html/rfc2965
The netscape source specification is here:
http://web.archive.org/web/20070805052634/http://wp.netscape.com/newsref/std/cookie_spec.html