Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1111773 of Cookie

  • Revision slug: Web/HTTP/Headers/Cookie
  • Revision title: Cookie
  • Revision id: 1111773
  • Created:
  • Creator: fscholz
  • Is current revision? Yes
  • Comment fix github url

Revision Content

{{HTTPSidebar}}

The Cookie HTTP request header contains stored HTTP cookies previously sent by the server with the {{HTTPHeader("Set-Cookie")}} header.

The Cookie header might be omitted entirely, if the privacy setting of the browser are set to block them, for example.

Header type {{Glossary("Request header")}}
{{Glossary("Forbidden header name")}} yes

Syntax

Cookie: <cookie-list>
Cookie: name=value
Cookie: name=value; name2=value2; name3=value3
<cookie-list>
A list of name-value pairs in the form of <cookie-name>=<cookie-value>. Pairs in the list are separated by a semi-colon and a space ('; ').

Examples

Cookie: PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1;

Specifications

Specification Title
{{RFC("6265", "Cookie", "5.4")}} HTTP State Management Mechanism

Browser compatibility

{{Compat}}

See also

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

Revision Source

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

<p>The <strong><code>Cookie</code></strong> HTTP request header contains stored <a href="/en-US/docs/Web/HTTP/Cookies">HTTP cookies</a> previously sent by the server with the {{HTTPHeader("Set-Cookie")}} header.</p>

<p>The <code>Cookie</code> header might be omitted entirely, if the privacy setting of the browser are set to block them, for example.</p>

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

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

<pre class="syntaxbox">
Cookie: &lt;cookie-list&gt;
Cookie: name=value
Cookie: name=value; name2=value2; name3=value3</pre>

<dl>
 <dt>&lt;cookie-list&gt;</dt>
 <dd>A list of name-value pairs in the form of <code>&lt;cookie-name&gt;=&lt;cookie-value&gt;</code>. Pairs in the list are separated by a semi-colon and a space (<code>'; '</code>).</dd>
</dl>

<h2 id="Examples">Examples</h2>

<pre>
Cookie: PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1;</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("6265", "Cookie", "5.4")}}</td>
   <td>HTTP State Management Mechanism</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">https://github.com/mdn/browser-compat-data</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