New sessions keep expiring after only 1 day, despite config being set to 7 days
Hi,
I created a Next.js project with better-auth recently, but I keep running into a problem: every time I create a new session by signing-in, the session expires after only 1 day. I'm not sure why this is happening, it happens even if I specify 7 days for the
expiresIn property under session. Attached is a screenshot of what the session looks like in my database and below is my config file.
Does anyone have any thoughts why this is happening?
Does anyone have any ideas why?
Solution:Jump to solution
edit: found this: https://www.answeroverflow.com/m/1368842749419196476
Session Expiration Limited to 1 Day Despite 7-Day Configuration - B...
We're experiencing a session expiration issue with Better Auth where our sessions are only valid for 1 day instead of 7, despite the specified configuration.
In our logs, we can see session creation with:
**Relevant...
1 Reply
Solution
edit: found this: https://www.answeroverflow.com/m/1368842749419196476
Session Expiration Limited to 1 Day Despite 7-Day Configuration - B...
We're experiencing a session expiration issue with Better Auth where our sessions are only valid for 1 day instead of 7, despite the specified configuration.
In our logs, we can see session creation with:
**Relevant...