diff --git a/app/auth.py b/app/auth.py index a10fbe5..fbe0e8a 100644 --- a/app/auth.py +++ b/app/auth.py @@ -30,7 +30,7 @@ def login(): user.update_last_login() db.session.commit() login_user(user) - + session.permanent = True next_page = request.args.get('next') if next_page: safe_next = next_page.replace('\\', '') @@ -56,6 +56,7 @@ def login(): user.update_last_login() db.session.commit() login_user(user) + session.permanent = True next_page = request.args.get('next') if next_page: diff --git a/app/config.py b/app/config.py index c653468..9d93848 100644 --- a/app/config.py +++ b/app/config.py @@ -1,4 +1,5 @@ import os +from datetime import timedelta class Config: # Core settings @@ -10,7 +11,7 @@ class Config: SESSION_COOKIE_HTTPONLY = True SESSION_COOKIE_SAMESITE = 'Lax' SESSION_COOKIE_SECURE = True # Set to True if using HTTPS - PERMANENT_SESSION_LIFETIME = 72000 # 20 hours + PERMANENT_SESSION_LIFETIME = timedelta(days=1) # 1 day session time # JSON configuration JSON_AS_ASCII = False