Semicolon ;
, the Cookie:
string or some other string?
The Cookie:
header has the following syntax:
Cookie: <Name> = <Value> { ; <Name> = <Value> }
Hence individual cookies are separated with the semicolon and a space.
On the other hand, when setting a cookie in the response, there one cookie per the Set-Cookie:
header:
Set-Cookie: <Name> = <Value> [ ; expires = <Date>] [ ; path = <Path> ] [ ; domain = <Domain> ] // etc…
To set multiple cookies the Set-Cookie
header is repeated in an HTTP response.
Notes:
Cookie2
and Set-Cookie2
which were abandoned.Set-Cookie
(or Set-Cookie2
) headers into one. However, this folding is not recommended by the latest RFC 6265 spec.