diff options
Diffstat (limited to 'files/zh-cn/web/http/headers/cookie/index.html')
-rw-r--r-- | files/zh-cn/web/http/headers/cookie/index.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/files/zh-cn/web/http/headers/cookie/index.html b/files/zh-cn/web/http/headers/cookie/index.html new file mode 100644 index 0000000000..a4aaff7f30 --- /dev/null +++ b/files/zh-cn/web/http/headers/cookie/index.html @@ -0,0 +1,72 @@ +--- +title: Cookie +slug: Web/HTTP/Headers/Cookie +tags: + - Cookies + - HTTP + - 请求 + - 超文本传输协议 + - 首部 +translation_of: Web/HTTP/Headers/Cookie +--- +<div>{{HTTPSidebar}}</div> + +<p><strong><code>Cookie</code></strong> 是一个请求首部,其中含有先前由服务器通过 {{HTTPHeader("Set-Cookie")}} 首部投放并存储到客户端的 <a href="/en-US/docs/Web/HTTP/Cookies">HTTP cookies</a>。</p> + +<p>这个首部可能会被完全移除,例如在浏览器的隐私设置里面设置为禁用cookie。</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="语法">语法</h2> + +<pre class="syntaxbox">Cookie: <cookie-list> +Cookie: name=value +Cookie: name=value; name2=value2; name3=value3</pre> + +<dl> + <dt><cookie-list></dt> + <dd>一系列的名称/值对,形式为 <code><cookie-name>=<cookie-value>。</code>名称/值对之间用分号和空格 ('; ')隔开。</dd> +</dl> + +<h2 id="示例">示例</h2> + +<pre>Cookie: PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1;</pre> + +<h2 id="规范">规范</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="浏览器兼容性">浏览器兼容性</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("http.headers.Cookie")}}</p> + +<h2 id="相关内容">相关内容</h2> + +<ul> + <li>{{HTTPHeader("Set-Cookie")}}</li> + <li>{{domxref("Document.cookie")}}</li> +</ul> |