Posts tagged “cookies”
-
CSRF, CORS and SameSite cookies: what each actually protects
CORS doesn't protect your server; it decides which other sites may read your responses in a browser. CSRF is another site making the browser send a request with your cookies, and SameSite cookies stop most of it, but not all. Fetch Metadata headers and a CSRF token close the rest. What each layer…
-
Sessions or JWTs: which should you use to keep users signed in?
Two good ideas for different jobs. For a web app with its own backend, server-side sessions are simpler and safer: a random cookie, instant revocation, nothing sensitive in the browser. JWTs earn their place between services and across organisations, where checking a signature beats a database…