Cookies vs localStorage: What to Check on Your Website
Last updated: November 15, 2026
An analytics cookie report can be empty while an integration still recognizes a visitor. An identifier may use another storage mechanism, or a request may carry data without saving a cookie. A useful audit separates where data is stored, what it is used for and when the service starts. This guide turns those distinctions into a practical workflow for website owners.
Three storage mechanisms at a glance
Browsers can attach cookies to matching HTTP requests. localStorage and sessionStorage are accessed by page scripts rather than automatically included in the Cookie header. A script can still read either store and send its contents in a request. Local storage therefore does not mean data stays on the device.
| Mechanism | Lifetime | Audit focus |
|---|---|---|
| Cookies | Expires / Max-Age, or a session cookie without them | Scope and transmission |
| localStorage | No built-in expiration | Application retention logic and readers |
| sessionStorage | Page session; survives reloads | Tab-specific state |
References: MDN: Set-Cookie · MDN: localStorage · MDN: sessionStorage
Classify by purpose, not by storage name
Consider a store with a basket, a language selector, analytics and an advertising pixel. Each may create browser records, but their purposes differ. An unfamiliar key is not automatically marketing, and a record on your own domain is not automatically necessary.
Identify the feature that creates each record, the stored information, any recipient and the effect of disabling it. A theme preference and a persistent advertising identifier need different explanations. Assign categories from observed behavior and provider documentation rather than from the developer’s preferred storage API.
- Basket: establish whether it stores items or a reference to a server session.
- Interface settings: separate language preferences from analytics identifiers.
- Analytics: match records to requests and the provider’s documentation.
- Unknown records: identify the integration owner before assigning a category.
Inspect storage with independent test scenarios
Use a separate browser profile and a test account. Open developer tools before loading the site. Chrome’s Application panel exposes cookies and web storage; inspect the relevant origin instead of assuming every record belongs to the top-level page.
Run three independent scenarios: no choice, rejection of optional categories and acceptance of statistics. Start each from the same clean state. Accepting everything and then rejecting tests withdrawal, which is different from a first visit.
Record key names, purpose, creation timing and the responsible integration. Mask customer identifiers and authentication tokens in screenshots or shared audit notes. A reproducible sequence is usually more useful than an unredacted storage dump.
References: Chrome: inspect local storage · Chrome: inspect cookies
Empty storage does not complete the audit
Inspect network activity alongside storage. A service can receive a request without creating a new identifier. An existing record also does not establish that its owner ran during the current scenario. Match timing and initiators to the action you are testing.
For example, a product page may create no cookies on load but contact a chat provider after scrolling. Check whether opening the chat changes storage later. Describe the resulting issue precisely: which service starts, after which action and what the expected behavior is.
References: Troubleshoot analytics before consent
Connect the inventory to consent controls
Create a map from each service to its category, installation point and startup condition. Where optional analytics must wait for consent, gate the code that runs it. Changing its storage mechanism does not prevent transmission or establish a startup condition.
Cookiestack supports deferred custom scripts marked with type="text/plain" and data-cookie-category when autoBlock is enabled. Update the existing installation rather than adding a second copy. Verify both rejection and acceptance: an allowed integration should initialize once and remain functional.
References: Cookiestack script blocking
Turn findings into reproducible tasks
For each issue, provide the page, initial state, visitor action, observed record or request, and expected result. Name the service responsible so the developer can locate its CMS setting, template snippet or tag manager entry.
Retest the homepage, a product page and a page with an external widget. Include a returning visit without clearing data. This checks that the site remembers the visitor’s choice as well as controlling the integrations that depend on it.
Frequently asked questions
Should I inspect localStorage when a scanner finds no cookies?
Yes, when your goal is to understand connected services. A cookie inventory is only part of that investigation. Add other storage areas and network behavior to the consent scenarios.
Does deleting cookies also delete localStorage?
They are separate stores. The outcome depends on the browser cleanup command you choose. Inspect both afterwards instead of relying on the button label.
Where does Cookiestack save a visitor’s choice?
The current widget uses the cb_consent localStorage record. When reading it, the widget checks its age against the domain’s cookieExpiry configuration. Despite the setting name, the record is not an HTTP cookie.