
Session cookies are the keys to your users' accounts. A few attributes on each cookie decide whether it can be stolen by scripts, sent over plain HTTP, or attached to requests from other websites.
Frameworks do not always set safe defaults. A session cookie without HttpOnly can be read by an XSS payload, one without Secure can leak over HTTP, and one without a suitable SameSite value is sent on cross-site requests, enabling CSRF.
Secure and HttpOnly on all session and authentication cookies.SameSite=Lax or Strict; only use None when needed, and always with Secure.__Host- prefix for the most sensitive cookies.HttpOnly stops JavaScript from reading the cookie, so an XSS payload cannot steal the session token.
Lax is a good default for session cookies; Strict is stronger. Only use None when cross-site sending is required, and always with Secure.
Try Vooki Pro free for 7 days
Find weak cookies before an attacker steals a session. The trial unlocks every feature for 7 days, and scanning runs on your own machine.
Related: HTTPS done right: HSTS and TLS configuration · Session management best practices