ryanisaboi1
ryanisaboi1
BABetter Auth
Created by Ravi on 2/21/2025 in #help
signInEmail isn't properly setting cookies in production? (NextJS 15/Vercel)
I think i'm running into the same problem! it seems like the the response to signing in is only setting the better-auth.session_token cookie but in production better-auth is expecting __Secure-better-auth.session_token https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/cookies/index.ts#L250
Response {
status: 200,
statusText: '',
headers: Headers {
'set-cookie': 'better-auth.session_token=SESSION_TOKEN; Max-Age=604800; Path=/; HttpOnly; SameSite=Lax',
'Content-Type': 'application/json'
},
body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
bodyUsed: false,
ok: true,
redirected: false,
type: 'default',
url: ''
}
Response {
status: 200,
statusText: '',
headers: Headers {
'set-cookie': 'better-auth.session_token=SESSION_TOKEN; Max-Age=604800; Path=/; HttpOnly; SameSite=Lax',
'Content-Type': 'application/json'
},
body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
bodyUsed: false,
ok: true,
redirected: false,
type: 'default',
url: ''
}
4 replies