gh-136992: Add 'None' as valid SameSite value as per RFC6265bis#137040
Merged
picnixz merged 7 commits intopython:mainfrom Jul 27, 2025
Merged
gh-136992: Add 'None' as valid SameSite value as per RFC6265bis#137040picnixz merged 7 commits intopython:mainfrom
picnixz merged 7 commits intopython:mainfrom
Conversation
Member
ZeroIntensity
left a comment
There was a problem hiding this comment.
The change looks good to me, but please run pre-commit to fix the failing lint job.
ZeroIntensity
approved these changes
Jul 24, 2025
Member
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM.
For future reference, you don't need to force push; we squash at the end.
Contributor
Author
|
Thanks for the heads-up! I’ll avoid force-pushing next time. |
picnixz
reviewed
Jul 25, 2025
picnixz
reviewed
Jul 25, 2025
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz
reviewed
Jul 26, 2025
picnixz
reviewed
Jul 26, 2025
picnixz
reviewed
Jul 26, 2025
picnixz
reviewed
Jul 26, 2025
picnixz
approved these changes
Jul 27, 2025
Member
|
Now, don't touch your branch at all. No need to update it either. |
|
Thanks @iqra-codes for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 27, 2025
…bis (pythonGH-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 ae8b7d7) Co-authored-by: Iqra Khan <iqraakhan2519@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Member
|
Thank you for the contribution! |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 27, 2025
…bis (pythonGH-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 ae8b7d7) Co-authored-by: Iqra Khan <iqraakhan2519@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-137140 is a backport of this pull request to the 3.14 branch. |
|
GH-137141 is a backport of this pull request to the 3.13 branch. |
picnixz
added a commit
that referenced
this pull request
Jul 27, 2025
…5bis (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 ae8b7d7) Co-authored-by: Iqra Khan <iqraakhan2519@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Contributor
Author
|
Thank you! Happy to contribute ..! |
Agent-Hellboy
pushed a commit
to Agent-Hellboy/cpython
that referenced
this pull request
Aug 19, 2025
…bis (python#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>
kumaraditya303
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Sep 9, 2025
…FC 6265bis (pythonGH-137040) (python#137140) Co-authored-by: Iqra Khan <iqraakhan2519@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds missing documentation for the samesite attribute in the http.cookies module.
While the attribute was already listed among valid Morsel attributes, it lacked an explanation. This change adds clear and complete documentation explaining:
-The attribute’s role in CSRF protection.
-The valid values: "Strict", "Lax", and "None".
-The requirement that "secure" must be set when using "SameSite=None".
This update brings the documentation in line with RFC6265bis and reflects current browser behaviour.
📚 Documentation preview 📚: https://cpython-previews--137040.org.readthedocs.build/
http.cookiesshould mention thatsamesite=Noneis valid as per RFC6265bis #136992