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

  1. A.localStorage
  2. B.A JavaScript global variable
  3. C.An HttpOnly, Secure, SameSite cookie set by the server
  4. 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 →