mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 17:24:23 -04:00
Merge pull request #175 from alphagov/fix_cookie_2025_bug
Fix for bug of cookie expiry.
This commit is contained in:
@@ -46,7 +46,7 @@ class ItsdangerousSessionInterface(SessionInterface):
|
|||||||
domain=domain)
|
domain=domain)
|
||||||
return
|
return
|
||||||
session.permanent = True
|
session.permanent = True
|
||||||
expires = datetime.utcnow() + timedelta(app.config.get('PERMANENT_SESSION_LIFETIME'))
|
expires = datetime.utcnow() + timedelta(seconds=app.config.get('PERMANENT_SESSION_LIFETIME'))
|
||||||
val = self.get_serializer(app).dumps(dict(session))
|
val = self.get_serializer(app).dumps(dict(session))
|
||||||
response.set_cookie(app.session_cookie_name, val,
|
response.set_cookie(app.session_cookie_name, val,
|
||||||
expires=expires, httponly=True,
|
expires=expires, httponly=True,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class Config(object):
|
|||||||
SESSION_COOKIE_HTTPONLY = True
|
SESSION_COOKIE_HTTPONLY = True
|
||||||
SESSION_COOKIE_SECURE = False
|
SESSION_COOKIE_SECURE = False
|
||||||
PERMANENT_SESSION_LIFETIME = 3600 # seconds
|
PERMANENT_SESSION_LIFETIME = 3600 # seconds
|
||||||
|
SESSION_REFRESH_EACH_REQUEST = True
|
||||||
|
|
||||||
API_HOST_NAME = os.getenv('API_HOST_NAME')
|
API_HOST_NAME = os.getenv('API_HOST_NAME')
|
||||||
NOTIFY_API_SECRET = os.getenv('NOTIFY_API_SECRET', "dev-secret")
|
NOTIFY_API_SECRET = os.getenv('NOTIFY_API_SECRET', "dev-secret")
|
||||||
|
|||||||
Reference in New Issue
Block a user