Weird behavior when rememberMe is false.
When logging in with
rememberMe: false
, the session cookie is created and stored correctly (verified in browser + DB), but /v1/session
(or /api/auth/get-session
) returns null. With rememberMe: true
, everything works fine. Both od the endpoints returns the session.
What i've tried:
Cookies are correctly set (better-auth.session_token, dont_remember
) and sent with credentials: "include"
.
Headers forwarded correctly in /v1/login
, including Set-Cookie
.
Tried removing secure, no change.
Session exists in the DB.
When visiting /v1/session
, still getting null.
I'm using Next.js as the frontend and the Hono as separate backend where better auth is running.
Here's the login route:
0 Replies