Local storage
Also called: localStorage, Session storage, Web storage
Browser storage where websites keep data that survives closing the tab, like settings or a cart.
Definition
Local storage (localStorage) keeps key-value data in the browser for one origin until the site or the user clears it, and is shared by all tabs of that site. Its sibling, session storage (sessionStorage), works the same way but belongs to a single tab and is cleared when the tab closes. Unlike cookies, neither is sent to the server automatically. Testers inspect and edit both in DevTools, and check that nothing sensitive is stored there.
In practice
The shopping cart lives in localStorage, so it's still there after closing the browser, which is expected. A plain-text password stored there is a security bug.
Learn it in context
Lessons that use this term.
Related terms
- CookieA small piece of data a website stores in your browser, for example to keep you logged in.
- IndexedDBA database inside the browser for larger structured data, often used for offline features.
- CacheStored copies of data or files that make apps and websites load faster.
- DevToolsDeveloper tools built into browsers for inspecting pages, network traffic and errors.