From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/http/headers/cookie/index.html | 72 ++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 files/zh-cn/web/http/headers/cookie/index.html (limited to 'files/zh-cn/web/http/headers/cookie/index.html') 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 +--- +
{{HTTPSidebar}}
+ +

Cookie 是一个请求首部,其中含有先前由服务器通过 {{HTTPHeader("Set-Cookie")}}  首部投放并存储到客户端的 HTTP cookies

+ +

这个首部可能会被完全移除,例如在浏览器的隐私设置里面设置为禁用cookie。

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

语法

+ +
Cookie: <cookie-list>
+Cookie: name=value
+Cookie: name=value; name2=value2; name3=value3
+ +
+
<cookie-list>
+
一系列的名称/值对,形式为 <cookie-name>=<cookie-value>。名称/值对之间用分号和空格 ('; ')隔开。
+
+ +

示例

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

规范

+ + + + + + + + + + + + +
SpecificationTitle
{{RFC("6265", "Cookie", "5.4")}}HTTP State Management Mechanism
+ +

浏览器兼容性

+ + + +

{{Compat("http.headers.Cookie")}}

+ +

相关内容

+ + -- cgit v1.2.3-54-g00ecf