Skip to content

http.cookies should mention that samesite=None is valid as per RFC6265bis #136992

@schlenk

Description

@schlenk

Documentation

The http.cookies.rst mentions this:

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".

But the samesite spec now also allows "None" and the code already allows it.

>>> import http.cookies
>>> sk = http.cookies.SimpleCookie()
>>> sk['test'] = ''
>>> sk['test']['samesite'] = 'None'
>>> sk.output()
'Set-Cookie: test=""; SameSite=None'

Linked PRs

Metadata

Metadata

Assignees

Labels

docsDocumentation in the Doc dir

Projects

Status

No status

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions