🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.HttpOnly
  2. B.Secure
  3. C.SameSite
  4. 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 →