Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
review feedback
  • Loading branch information
alex committed Apr 7, 2018
commit 9259d2e401b6ed17ba7361897ff2dd0e18c23929
9 changes: 4 additions & 5 deletions Doc/library/http.cookies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,9 @@ 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 browser is not allowed to send the
cookie along with cross-site requests. This help to mitigate CSRF attacks. Valid
values for this attribute are "Strict" and "Lax".

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 keys are case-insensitive and their default value is ``''``.

Expand All @@ -160,7 +159,7 @@ Morsel Objects
setting them.

.. versionchanged:: 3.8
Added support for :attr:`samesite` attribute.
Added support for the :attr:`samesite` attribute.


.. attribute:: Morsel.value
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_http_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_set_secure_httponly_attrs(self):
'Set-Cookie: Customer="WILE_E_COYOTE"; HttpOnly; Secure')

def test_samesite_attrs(self):
samesite_values = ['Strict', 'Lax']
samesite_values = ['Strict', 'Lax', 'strict', 'lax']
for val in samesite_values:
with self.subTest(val=val):
C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"')
Expand Down