https://github.com/python/cpython/commit/97f5fdf567c61851fee38f1f1d0d073777d94f4a
commit: 97f5fdf567c61851fee38f1f1d0d073777d94f4a
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: picnixz <[email protected]>
date: 2025-07-27T22:08:46+02:00
summary:

[3.13] gh-136992: Add "None" as valid `SameSite` value as per RFC 6265bis 
(GH-137040) (#137141)

gh-136992: Add "None" as valid `SameSite` value as per RFC 6265bis (GH-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

---------
(cherry picked from commit ae8b7d710020dfd336edd399fa35525dfe8fc049)

Co-authored-by: Iqra Khan <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>

files:
M Doc/library/http.cookies.rst

diff --git a/Doc/library/http.cookies.rst b/Doc/library/http.cookies.rst
index ad37a0fca4742d..845c2df5c536ae 100644
--- a/Doc/library/http.cookies.rst
+++ b/Doc/library/http.cookies.rst
@@ -147,9 +147,12 @@ Morsel Objects
    in HTTP requests, and is not accessible through JavaScript. This is intended
    to mitigate some forms of cross-site scripting.
 
-   The attribute :attr:`samesite` specifies that the browser is not allowed to
-   send the cookie along with cross-site requests. This helps to mitigate CSRF
-   attacks. Valid values for this attribute are "Strict" and "Lax".
+   The attribute :attr:`samesite` controls when the browser sends the cookie 
with
+   cross-site requests. This helps to mitigate CSRF attacks. Valid values are
+   "Strict" (only sent with same-site requests), "Lax" (sent with same-site
+   requests and top-level navigations), and "None" (sent with same-site and
+   cross-site requests). When using "None", the "secure" attribute must also
+   be set, as required by modern browsers.
 
    The keys are case-insensitive and their default value is ``''``.
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to