summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert JW Regeer <bertjw@regeer.org>2018-06-05 19:00:21 -0600
committerBert JW Regeer <bertjw@regeer.org>2018-06-05 19:00:21 -0600
commit6c8ad427ee2f99c30e52667d5a90226de18d2b2d (patch)
tree0f0e3b2d3583e9bbcbfac0fb3486438101e191f6
parent0a998e40bd33d859aa2494fc06d28f138fca3c58 (diff)
downloadpyramid-6c8ad427ee2f99c30e52667d5a90226de18d2b2d.tar.gz
pyramid-6c8ad427ee2f99c30e52667d5a90226de18d2b2d.tar.bz2
pyramid-6c8ad427ee2f99c30e52667d5a90226de18d2b2d.zip
samesite no longer requires bytes
-rw-r--r--pyramid/session.py12
-rw-r--r--pyramid/tests/test_session.py2
2 files changed, 7 insertions, 7 deletions
diff --git a/pyramid/session.py b/pyramid/session.py
index 25ed29878..70af99085 100644
--- a/pyramid/session.py
+++ b/pyramid/session.py
@@ -135,7 +135,7 @@ def BaseCookieSessionFactory(
domain=None,
secure=False,
httponly=False,
- samesite=b'Lax',
+ samesite='Lax',
timeout=1200,
reissue_time=0,
set_on_exception=True,
@@ -189,7 +189,7 @@ def BaseCookieSessionFactory(
session cookie. Default: ``False``.
``samesite``
- The 'samesite' option of the session cookie. Default ``b'Lax'``.
+ The 'samesite' option of the session cookie. Default ``'Lax'``.
``timeout``
A number of seconds of inactivity before a session times out. If
@@ -388,7 +388,7 @@ def UnencryptedCookieSessionFactoryConfig(
cookie_domain=None,
cookie_secure=False,
cookie_httponly=False,
- cookie_samesite=b'Lax',
+ cookie_samesite='Lax',
cookie_on_exception=True,
signed_serialize=signed_serialize,
signed_deserialize=signed_deserialize,
@@ -442,7 +442,7 @@ def UnencryptedCookieSessionFactoryConfig(
The 'httpOnly' flag of the session cookie.
``cookie_samesite``
- The 'samesite' option of the session cookie. Default: ``b'Lax'``.
+ The 'samesite' option of the session cookie. Default: ``'Lax'``.
``cookie_on_exception``
If ``True``, set a session cookie even if an exception occurs
@@ -502,7 +502,7 @@ def SignedCookieSessionFactory(
domain=None,
secure=False,
httponly=False,
- samesite=b'Lax',
+ samesite='Lax',
set_on_exception=True,
timeout=1200,
reissue_time=0,
@@ -566,7 +566,7 @@ def SignedCookieSessionFactory(
session cookie. Default: ``False``.
``samesite``
- The 'samesite' option of the session cookie. Default: ``b'Lax'``.
+ The 'samesite' option of the session cookie. Default: ``'Lax'``.
``timeout``
A number of seconds of inactivity before a session times out. If
diff --git a/pyramid/tests/test_session.py b/pyramid/tests/test_session.py
index 3dd82b5f3..e3d819944 100644
--- a/pyramid/tests/test_session.py
+++ b/pyramid/tests/test_session.py
@@ -504,7 +504,7 @@ class TestUnencryptedCookieSession(SharedCookieSessionTests, unittest.TestCase):
expected_cookieval = dummy_signed_serialize(
(session.accessed, session.created, {'key': 'value'}), secret)
response = Response()
- response.set_cookie('session', expected_cookieval, samesite=b'Lax')
+ response.set_cookie('session', expected_cookieval, samesite='Lax')
expected_cookie = response.headerlist[-1][1]
self.assertEqual(cookie, expected_cookie)