Skip to content

EasyConceptBrowser, networking and security

What is the difference between localStorage, sessionStorage and cookies?

What a good answer covers

localStorage persists with no expiry, sessionStorage lasts for the tab session, and cookies are sent with every request to their domain and can be HttpOnly, Secure and SameSite. Do not store tokens in localStorage if XSS is a concern.

More on Browser, networking and security

Flashcards for this topic