Skip to content
Snippets Groups Projects
Commit 77d2c30c authored by Russ Garrett's avatar Russ Garrett Committed by Julian
Browse files

Use permanent rather than session cookies

parent 2b5ab52b
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,12 @@ USER_SERVICE_MAX_UID=19999
GROUP_MIN_GID=20000
GROUP_MAX_GID=49999
# The period of time that a login lasts for.
SESSION_LIFETIME_SECONDS=3600
# The period of time that the session cookie lasts for. This is refreshed on each page load.
PERMANENT_SESSION_LIFETIME=2678400
# CSRF protection
SESSION_COOKIE_SECURE=True
SESSION_COOKIE_HTTPONLY=True
......
......@@ -49,6 +49,7 @@ def logout():
def set_session(user, skip_mfa=False):
session.clear()
session.permanent = True
session['user_id'] = user.id
session['logintime'] = datetime.datetime.now().timestamp()
session['_csrf_token'] = secrets.token_hex(128)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment