What does the HttpOnly flag prevent?
- Script reading the cookie
- Sending over plain HTTP
- Sharing with subdomains
- Storing beyond the session
HttpOnly hides the cookie from document.cookie, so an XSS payload cannot steal it directly.
Play Cybersecurity ▸