SameSite support
This commit is contained in:
@@ -165,6 +165,7 @@ class SessionInterface(QuartSessionInterface):
|
|||||||
domain=domain, path=path)
|
domain=domain, path=path)
|
||||||
return
|
return
|
||||||
httponly = self.get_cookie_httponly(app)
|
httponly = self.get_cookie_httponly(app)
|
||||||
|
samesite = self.get_cookie_samesite(app)
|
||||||
secure = self.get_cookie_secure(app)
|
secure = self.get_cookie_secure(app)
|
||||||
expires = self.get_expiration_time(app, session)
|
expires = self.get_expiration_time(app, session)
|
||||||
|
|
||||||
@@ -176,7 +177,7 @@ class SessionInterface(QuartSessionInterface):
|
|||||||
session_id = session.sid
|
session_id = session.sid
|
||||||
response.set_cookie(app.session_cookie_name, session_id,
|
response.set_cookie(app.session_cookie_name, session_id,
|
||||||
expires=expires, httponly=httponly,
|
expires=expires, httponly=httponly,
|
||||||
domain=domain, path=path, secure=secure)
|
domain=domain, path=path, secure=secure, samesite=samesite)
|
||||||
|
|
||||||
async def create(self, app: Quart):
|
async def create(self, app: Quart):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
@@ -316,7 +317,7 @@ class MemcachedSessionInterface(SessionInterface):
|
|||||||
if self.backend is None:
|
if self.backend is None:
|
||||||
import aiomcache
|
import aiomcache
|
||||||
loop = asyncio.get_running_loop()
|
loop = asyncio.get_running_loop()
|
||||||
self.backend = aiomcache.Client("127.0.0.1", 11211, loop=loop)
|
#self.backend = aiomcache.Client("127.0.0.1", 11211, loop=loop)
|
||||||
self.backend = aiomcache.Client(self._config.get('SESSION_MEMCACHED_HOST', '127.0.0.1'),
|
self.backend = aiomcache.Client(self._config.get('SESSION_MEMCACHED_HOST', '127.0.0.1'),
|
||||||
self._config.get('SESSION_MEMCACHED_PORT', 11211),
|
self._config.get('SESSION_MEMCACHED_PORT', 11211),
|
||||||
loop=loop)
|
loop=loop)
|
||||||
|
|||||||
Reference in New Issue
Block a user