Browser & Web Performance · Junior · Question 68 of 75

Why is storing an auth token in localStorage considered risky?

Explanation

localStorage has no HttpOnly equivalent. An HttpOnly, Secure, SameSite cookie keeps the token out of reach of JS.

Further reading

Problem with a question

Browser & Web Performance · Junior · question 68

Test yourself

Take the Browser & Web Performance · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz