Skip to content

Commit ae8b7d7

Browse files
iqra-codespicnixz
andauthored
gh-136992: Add "None" as valid SameSite value as per RFC 6265bis (#137040)
The "SameSite" attribute defined in RFC 6265bis [1] allows the "Strict", "Lax" and "None" enforcement modes. We already documented "Strict" and "Lax" as being valid values but "None" was missing from the list. While the RFC has not been formally approved, modern browsers support the "None" value [2, 3] thereby making sense to document it. [1]: https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis [2]: https://developers.google.com/search/blog/2020/01/get-ready-for-new-samesitenone-secure [3]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie#none --------- Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent cfd6da8 commit ae8b7d7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Doc/library/http.cookies.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,12 @@ Morsel Objects
148148
in HTTP requests, and is not accessible through JavaScript. This is intended
149149
to mitigate some forms of cross-site scripting.
150150

151-
The attribute :attr:`samesite` specifies that the browser is not allowed to
152-
send the cookie along with cross-site requests. This helps to mitigate CSRF
153-
attacks. Valid values for this attribute are "Strict" and "Lax".
151+
The attribute :attr:`samesite` controls when the browser sends the cookie with
152+
cross-site requests. This helps to mitigate CSRF attacks. Valid values are
153+
"Strict" (only sent with same-site requests), "Lax" (sent with same-site
154+
requests and top-level navigations), and "None" (sent with same-site and
155+
cross-site requests). When using "None", the "secure" attribute must also
156+
be set, as required by modern browsers.
154157

155158
The attribute :attr:`partitioned` indicates to user agents that these
156159
cross-site cookies *should* only be available in the same top-level context

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy