← Quiz: HTTPS, Cookies and Headers: all 10 questions
Quiz: HTTPS, Cookies and Headers · Question 1 of 10
Which cookie flag stops JavaScript (and therefore most XSS attacks) from reading the session cookie?
Which cookie flag stops JavaScript (and therefore most XSS attacks) from reading the session cookie?
- A.HttpOnly
- B.Secure
- C.SameSite
- D.Path
Answer & explanation
Correct answer: HttpOnly
HttpOnly hides the cookie from document.cookie. Secure is about HTTPS-only sending, SameSite about cross-site requests.
Can you get the rest right without peeking?
Take the timed Quiz: HTTPS, Cookies and Headers quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →