What does the HttpOnly flag do?
Set-Cookie: session=abc; HttpOnly; Secure
- Blocks JavaScript cookie access
- Encrypts the whole response
- Extends the cookie lifetime
- Shares it across domains
HttpOnly hides the cookie from document.cookie, mitigating XSS theft.
Play Cybersecurity ▸