← Quiz: Browser Storage and Cookies: all 10 questions
Quiz: Browser Storage and Cookies · Question 5 of 10
What does the HttpOnly cookie attribute do?
What does the HttpOnly cookie attribute do?
- A.Sends the cookie only over HTTP, not HTTPS
- B.Stops JavaScript from reading the cookie, so an injected script cannot steal it
- C.Deletes the cookie when the tab closes
- D.Makes the cookie larger
Answer & explanation
Correct answer: Stops JavaScript from reading the cookie, so an injected script cannot steal it
HttpOnly cookies are still sent to the server but are hidden from document.cookie.
Can you get the rest right without peeking?
Take the timed Quiz: Browser Storage and Cookies quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →