What is the primary risk of using 'httpOnly: false' for a session cookie containing a sensitive JWT?
- A.Non-HttpOnly cookies are automatically sent via HTTP instead of HTTPS; rotating the session ID after login corrupts the browser's cookie jar and is discouraged by OWASP for that reason; HttpOnly also hides the cookie from the browser's DevTools, making it invisible to local inspection; logout only needs to delete the cookie client-side, because a session ID absent from the browser can never be replayed
- B.SameSite restrictions do not apply to non-HttpOnly cookies
- C.Without HttpOnly, JavaScript can read the cookie via document.cookie. Any XSS vulnerability - even in a third-party script - can exfiltrate the JWT to an attacker's server, providing a stolen valid session token. HttpOnly is the primary defense: cookies are sent with HTTP requests but are invisible to JavaScript