Cookie
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Cookie
是 HTTP 請求標頭,它的值包含由伺服器設定的 HTTP cookies (透過 Set-Cookie
標頭設定,或者透過 Javascript 的 Document.cookie
設定)。
Cookie
標頭不是必要的,比如瀏覽器可能會因為隱私設定而直接省略 Cookie 不傳。
Header type | Request header |
---|---|
Forbidden header name | yes |
Syntax
http
Cookie: <cookie-list>
Cookie: name=value
Cookie: name=value; name2=value2; name3=value3
-
一連串名值對(name-value pair),格式為:
<cookie-name>=<cookie-value>
。每對之間由一個分號與一個空白分隔('; '
)。
範例
Cookie: PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1
Specifications
Specification |
---|
HTTP State Management Mechanism # cookie |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Cookie |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.