Revision 1109969 of Set-Cookie2

  • Revision slug: Web/HTTP/Headers/Set-Cookie2
  • Revision title: Set-Cookie2
  • Revision id: 1109969
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment

Revision Content

{{HTTPSidebar}} {{obsolete_header}}

The obsolete Set-Cookie2 HTTP response header used to send cookies from the server to the user agent, but has been deprecated by the specification. Use {{HTTPHeader("Set-Cookie")}} instead.

Header type {{Glossary("Response header")}}
{{Glossary("Forbidden header name")}} no

Syntax

Set-Cookie2: <cookie-name>=<cookie-value> 
Set-Cookie2: <cookie-name>=<cookie-value>; Comment=<value>
Set-Cookie2: <cookie-name>=<cookie-value>; CommentURL=<http-url>
Set-Cookie2: <cookie-name>=<cookie-value>; Discard
Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>
Set-Cookie2: <cookie-name>=<cookie-value>; Max-Age=<non-zero-digit>
Set-Cookie2: <cookie-name>=<cookie-value>; Path=<path-value>
Set-Cookie2: <cookie-name>=<cookie-value>; Port=<port-number>
Set-Cookie2: <cookie-name>=<cookie-value>; Secure
Set-Cookie2: <cookie-name>=<cookie-value>; Version=<version-number>

// Multiple directives are also possible, for example:
Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure

// Multiple cookies are seperated by a comma
Set-Cookie2: <cookie-name>=<cookie-value>, <cookie-name>=<cookie-value>, ...

Specifications

Specification Title
{{RFC("2965", "Set-Cookie2")}} Historic specification of HTTP State Management Mechanism, obsoleted by {{RFC("6265")}}

Browser compatibility

{{Compat}}

See also

  • {{HTTPHeader("Set-Cookie")}}
  • {{domxref("Document.cookie")}}

Revision Source

<div>{{HTTPSidebar}} {{obsolete_header}}</div>

<p>The obsolete <strong><code>Set-Cookie2</code></strong> HTTP response header used to send cookies from the server to the user agent, but has been deprecated by the specification. Use {{HTTPHeader("Set-Cookie")}} instead.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header type</th>
   <td>{{Glossary("Response header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>no</td>
  </tr>
 </tbody>
</table>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt; 
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; Comment=&lt;value&gt;
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; CommentURL=&lt;http-url&gt;
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; Discard
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; Domain=&lt;domain-value&gt;
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; Max-Age=&lt;non-zero-digit&gt;
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; Path=&lt;path-value&gt;
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; Port=&lt;port-number&gt;
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; Secure
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; Version=&lt;version-number&gt;

// Multiple directives are also possible, for example:
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;; Domain=&lt;domain-value&gt;; Secure

// Multiple cookies are seperated by a comma
Set-Cookie2: &lt;cookie-name&gt;=&lt;cookie-value&gt;, &lt;cookie-name&gt;=&lt;cookie-value&gt;, ...
</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Title</th>
  </tr>
  <tr>
   <td>{{RFC("2965", "Set-Cookie2")}}</td>
   <td>Historic specification of HTTP State Management Mechanism, obsoleted by&nbsp;{{RFC("6265")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p class="hidden">The compatibility table in this page is generated from structured data. If you’d like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data/README.md">https://github.com/mdn/browser-compat-data/README.md</a> and send us a pull request.</p>

<p>{{Compat}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{HTTPHeader("Set-Cookie")}}</li>
 <li>{{domxref("Document.cookie")}}</li>
</ul>
Revert to this revision