Session cookie works on localhost but vanishes the moment I deploy Help
Login returns 200 and the Set-Cookie header is definitely in the response, I can see it in the network tab. The very next request goes out with no cookie at all and the API returns 401. On my machine everything works, because the dev server proxies /api to the backend. In production the frontend is on one host and the API is on another. I've been staring at this for two days.
@hotswap_hana · 2mo ago
Fastest way to confirm the diagnosis before you change any code: open the app, then look in devtools under Application, Cookies, and select the API's origin rather than the page's origin. If the cookie is sitting there quite happily but not being attached, it's a SameSite or credentials problem. If it isn't there at all, it's a Secure or Domain problem. Two very different afternoons.
Reply
Report