mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Update the cookie to secure on LIVE
Set the expiration of the cookie.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from datetime import timedelta, datetime
|
||||
|
||||
from werkzeug.datastructures import CallbackDict
|
||||
from flask.sessions import SessionInterface, SessionMixin
|
||||
from itsdangerous import URLSafeTimedSerializer, BadSignature
|
||||
@@ -43,7 +45,8 @@ class ItsdangerousSessionInterface(SessionInterface):
|
||||
response.delete_cookie(app.session_cookie_name,
|
||||
domain=domain)
|
||||
return
|
||||
expires = self.get_expiration_time(app, session)
|
||||
session.permanent=True
|
||||
expires= datetime.utcnow() + timedelta(app.config.get('PERMANENT_SESSION_LIFETIME'))
|
||||
val = self.get_serializer(app).dumps(dict(session))
|
||||
response.set_cookie(app.session_cookie_name, val,
|
||||
expires=expires, httponly=True,
|
||||
|
||||
Reference in New Issue
Block a user