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

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

Header type Request header
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;

规范

Specification Title
RFC 6265, section 5.4: Cookie HTTP State Management Mechanism

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support

相关内容

文档标签和贡献者

此页面的贡献者: WayneCui
最后编辑者: WayneCui,