Replies: 2 comments
-
One way to do it would be to put the cookie renewal logic in a shared sql file that is required at the top of other pages. Something like: ### shell.sql SELECT 'cookie' as component, 'session' as name, sqlpage.cookie('session') as value, 3600 as max_age
where EXISTS(SELECT 1 from sessions where id = sqlpage.cookie('session')); my_page.sqlSELECT 'dynamic' AS component, sqlpage.run_sql('shell.sql') AS properties; |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you! This was exactly the push I needed to resolve this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I’m looking for a way to implement a dynamic session timeout where the session cookie expires after a certain time limit, such as 15 minutes after the last user activity (e.g., page navigation, form submission, or any interaction).
Questions:
Is there a way to dynamically reset the session cookie expiration on each user request?
Can SQLPage modify or extend cookies dynamically when queries are executed?
If not, what would be the best approach to ensure the session remains active based on user interactions while enforcing a strict timeout when idle?
We tried using the max_age property, but it seems to be a hardcoded value that doesn’t update automatically upon new user activity.
Beta Was this translation helpful? Give feedback.
All reactions