Cookies often carry session tokens โ the keys to a logged-in account. Three flags decide how safely those keys are handled, and missing them is one of the most common findings in a web scan.
The three flags
- Secure โ the cookie is only ever sent over HTTPS, so it cannot leak over an unencrypted connection.
- HttpOnly โ JavaScript cannot read the cookie, which blocks token theft via cross-site scripting (XSS).
- SameSite โ controls whether the cookie is sent on cross-site requests.
LaxorStrictdefends against cross-site request forgery (CSRF).
Recommended setup
For session cookies, set all three: Set-Cookie: session=...; Secure; HttpOnly; SameSite=Lax; Path=/. Use SameSite=Strict for the most sensitive cookies, and never expose a session token to JavaScript. Run the web scan to see which of your cookies are missing these flags.