Open In App

HTTP headers | Set-Cookie2

The HTTP Set-cookie2 is response type header and it is obsoleted. It is a provider of the mechanism to serve and retrieve state information from the client to the server. The usage of this command is usually replaced by the set cookie instead of the set cookie2. The usage of this command cookie2 is obsoleted by the RFC 6265.

Syntax:



Set-Cookie2: <cookie-name>=<cookie-value> | Comment=<value> | Domain=<domain-value> | 
Max-Age=<non-zero-digit> | Path=<path-value> | Discard | Secure 

Note: Using multiple directives is also possible just need to separate them by using colon “;” and multiple cookies are separated by comma “,”.

Directives:



Example: This type of Set-cookie you may not found in the Header section of the Inspect Element of Network because it was Obsolete by the RFC 6265. Please avoid using it.

Set-Cookie2:Student="David"; Max-Age=12885; Path="/asdf"; Secure

Supported Browsers: The browsers are not compatible with HTTP header Set-Cookie2. The HTTP header Set-Cokkie2 was replaced by the HTTP header Set-Cookie.

Article Tags :