Browsing without an account — progress is saved in this browser only.Sign in to save it
Where the browser and the API disagree: sessions, cookies and CORS
Reading15 min
Sessions, cookies and CORS
A cookie session crosses three boundaries: CORS decides whether the browser lets a page use credentials, cookie attributes (Path, HttpOnly, SameSite) decide where the cookie travels and who can read it, and the CSRF token has to be read by script and echoed in a header. Break any one and sign-in looks fine while every later request fails. Reproduce with the network tab: check Set-Cookie flags, the request's Cookie header and the response's Access-Control-* headers.
Sign in to try this knowledge check.