Add session validity checks every x hours #806

Closed
opened 2026-03-13 08:05:13 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Eldevia on GitHub (Mar 7, 2025).

For security reasons i suggest adding option that it checks db for session validity if it hasnt expired.
I appreciate the maxAge option for session cookies, but i would also like an option to just have the betterauth check it like every 1hour.
because right now if we set maxAge to 1hr, it doesnt reassign 1hr again, it just bangs the db always after that.

Originally created by @Eldevia on GitHub (Mar 7, 2025). For security reasons i suggest adding option that it checks db for session validity if it hasnt expired. I appreciate the maxAge option for session cookies, but i would also like an option to just have the betterauth check it like every 1hour. because right now if we set maxAge to 1hr, it doesnt reassign 1hr again, it just bangs the db always after that.
Author
Owner

@Eldevia commented on GitHub (Mar 8, 2025):

okay seems like i fixed it by just including the auth response headers in loaders response object. it allowed the browser to receive and set the new session cookie.

@Eldevia commented on GitHub (Mar 8, 2025): okay seems like i fixed it by just including the auth response headers in loaders response object. it allowed the browser to receive and set the new session cookie.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#806