File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,17 @@ class Config:
3030 SESSION_COOKIE_SAMESITE = os .environ .get ('SESSION_COOKIE_SAMESITE' , 'Lax' )
3131 # Allow overriding secure flag for local HTTP testing (set SESSION_COOKIE_SECURE=false)
3232 SESSION_COOKIE_SECURE = _bool ('SESSION_COOKIE_SECURE' , default = False )
33- PERMANENT_SESSION_LIFETIME = timedelta (days = int (os .environ .get ('SESSION_LIFETIME_DAYS' , '1' )))
33+
34+ # Session lifetime configuration - defaults to 12 hours for better user experience
35+ _session_hours = int (os .environ .get ('SESSION_LIFETIME_HOURS' , '12' ))
36+ PERMANENT_SESSION_LIFETIME = timedelta (hours = _session_hours )
37+
38+ # Ensure session cookies persist across browser restarts
39+ SESSION_COOKIE_NAME = 'da_emailforwarder_session'
40+ SESSION_COOKIE_MAX_AGE = _session_hours * 3600 # Convert hours to seconds
41+
42+ # Refresh session on each request to prevent timeout during active use
43+ SESSION_REFRESH_EACH_REQUEST = True
3444
3545 # JSON configuration
3646 JSON_AS_ASCII = False
You can’t perform that action at this time.
0 commit comments