How localStorage Tracking Works and Why Clearing Cookies Is Not Enough
Patrick Bushe
March 26, 2026 · 5 min read
Cookies aren't the only place websites store data in your browser. localStorage holds data for each site, and it stays until the site or you delete it. Trackers use it to keep an ID, and sometimes to restore a cookie you deleted.
What localStorage is
- A small storage area each website gets in your browser, typically a few megabytes.
- Stays after you close the browser, with no expiry date.
- Readable only by scripts running on that site, not sent with every request like cookies.
Sites use it for normal things: saved settings, drafts, a game's progress or a shopping basket.
How it's used for tracking
- Storing an ID. An analytics or ad script on a site saves a unique ID in that site's localStorage and reads it on your next visit.
- Restoring deleted cookies. If you delete a tracking cookie but not localStorage, a script can find the saved ID and set the cookie again. These are sometimes called "zombie cookies".
- Across sites: Chrome now partitions storage for embedded third-party content by the site you're on, which makes it much harder for one tracker to use the same stored ID across different websites.
More on related techniques in supercookies explained.
Does clearing cookies clear localStorage?
- Yes, if you use Chrome's Delete browsing data and tick Cookies and other site data. That option also clears localStorage, IndexedDB and similar storage.
- Yes, if you delete a site's data from
chrome://settings/content/allor the site information menu. - No, if you delete only individual cookies, in DevTools or with a cookie-only extension. localStorage stays.
See how to delete cookies in Chrome.
See what a site stores
Press F12, open the Application tab, and expand Local storage under Storage. You'll see each key and value the site saved. Values with long random strings are often IDs.
Limit localStorage tracking
- Use a tracker blocker so tracking scripts don't run in the first place.
- Set Chrome to delete site data when you close all windows (Settings → Privacy and security → Site settings → On-device site data), with exceptions for sites you want to stay signed in to.
- Use Incognito for one-off visits; its storage is wiped when you close it.
- Ghost Browser adds random background browsing, so the profile built from whatever tracking remains is less accurate.