From 097d939b60a8f5c1f4aedb7cdaec6415fbd417fc Mon Sep 17 00:00:00 2001 From: Timeraider <57343973+GitTimeraider@users.noreply.github.com> Date: Thu, 7 Aug 2025 14:35:30 +0200 Subject: [PATCH] Change usage of variable session timer --- app/auth.py | 3 ++- app/config.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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