← Quiz: Browser Storage and Cookies: all 10 questions
Quiz: Browser Storage and Cookies · Question 8 of 10
Where should a user's login session id be stored for best security?
Where should a user's login session id be stored for best security?
- A.localStorage
- B.A JavaScript global variable
- C.An HttpOnly, Secure, SameSite cookie set by the server
- D.The URL query string
Answer & explanation
Correct answer: An HttpOnly, Secure, SameSite cookie set by the server
Scripts cannot read it, it travels only over HTTPS and SameSite limits cross-site requests.
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 →