Session Cache disappearing in Next.js
Expected behavior:
Cached session refreshes in cookies every
Current behavior:
Cached session disappears after
Better-Auth version
v1.1.3 (Latest)
Bug Details:
I started testing out session cache in my project, set the cache to
After logging in, the cached session
The only way I found to get the cached session back is to update the user, but then same loop happens, wait 30 seconds, disappear without being.
This is some of my auth options for reference. I'm also using the
Cached session refreshes in cookies every
30 secondsCurrent behavior:
Cached session disappears after
30 seconds and never gets refreshed, leaving better-auth to default back to bringing the session from the database.Better-Auth version
v1.1.3 (Latest)
Bug Details:
I started testing out session cache in my project, set the cache to
30 seconds and tried using it. After logging in, the cached session
better-auth.session_data stays in my cookies for 30 seconds and then disappears, never to return. Better-auth then defaults back to bringing the session from the database.The only way I found to get the cached session back is to update the user, but then same loop happens, wait 30 seconds, disappear without being.
This is some of my auth options for reference. I'm also using the
Oragnization plugin