Browser Storage Debugging Guide: Inspect Cookies, Local Storage, Session Storage, and IndexedDB
browser-devtoolscookieslocalstoragesessionstorageindexeddbfrontend-debugging

Browser Storage Debugging Guide: Inspect Cookies, Local Storage, Session Storage, and IndexedDB

CClicky Live Editorial Team
2026-11-17
8 min read

Learn how to inspect cookies, localStorage, sessionStorage, and IndexedDB, trace stale state, clear data safely, and build repeatable checks.

Browser storage problems often look like application bugs: a user appears logged out, an old preference returns, or a newly deployed interface behaves differently in one browser. This guide explains how to inspect cookies, localStorage, sessionStorage, and IndexedDB with browser DevTools, then turn observations into a repeatable debugging process. You will learn what each storage mechanism is for, which variables to record, how to clear data safely, and when to revisit your storage checks after releases or browser changes.

Overview

Web storage is not one shared data store. Cookies, localStorage, sessionStorage, and IndexedDB have different ownership rules, lifetimes, access patterns, and security characteristics. Troubleshooting becomes faster when you first identify which store should contain the value and then verify its scope, format, age, and reader.

Open your browser's developer tools and look for an Application, Storage, or similarly named panel. Interface names vary by browser and version, but the same inspection goals apply:

  • Find the exact origin, host, path, or partition associated with the value.
  • Check whether the value exists, has the expected type or serialization, and was recently changed.
  • Identify the code path that writes the value and the code path that reads it.
  • Compare behavior in a clean profile, private browsing context, or separate browser session when appropriate.

Cookies are sent with qualifying HTTP requests and are commonly used for server-managed sessions, preferences, and short-lived request state. Their behavior depends on attributes such as Domain, Path, Expires, Max-Age, Secure, HttpOnly, and SameSite. A cookie marked HttpOnly can be sent by the browser but is not available through client-side JavaScript.

localStorage stores string key-value pairs associated with an origin and generally remains available across browser restarts until application code or the user removes it. sessionStorage also stores strings, but its lifetime is tied to a browser page session and its visibility is more limited. Do not assume that two tabs share session storage simply because they show the same URL.

IndexedDB is an asynchronous database API suited to structured records, larger client-side datasets, indexes, and offline-oriented workflows. It is more capable than key-value storage, but it also introduces databases, object stores, indexes, transactions, and version upgrades that must be inspected separately.

What to track

Record enough detail to distinguish a missing value from a wrongly scoped, stale, overwritten, or incorrectly parsed value. A useful storage inventory includes the following fields:

FieldWhat to recordWhy it matters
Storage typeCookie, localStorage, sessionStorage, or IndexedDBDetermines the API, lifetime, and inspection path.
Key or recordExact key name, database, object store, and record identifierPrevents a near-match from being mistaken for the expected value.
ScopeOrigin, domain, path, tab context, and any relevant embedding contextExplains why one page or subdomain can see a value while another cannot.
Value formatPlain text, JSON string, encoded data, timestamp, or structured recordShows whether the problem is storage or serialization.
LifetimeSession behavior, expiration, or application-defined timestampSeparates legitimate expiry from unexpected deletion.
Writer and readerComponent, request, event handler, or service that writes and reads itCreates a path toward the responsible code.
Expected versus observedWhat should be present and what DevTools actually showsMakes the defect reproducible for another tester.

Inspecting cookies in DevTools

In the storage panel, expand the relevant site or origin and open its cookie list. Check duplicate-looking names across domains or paths; two cookies can share a name while differing in scope. Also inspect the Network panel for the request that sets the cookie and the request that should send it. A response may replace a cookie, assign a new expiration, or set attributes that prevent it from being sent in a particular context.

When debugging authentication, compare the cookie shown in the storage panel with request headers and server responses. Avoid pasting session cookies into online tools, tickets, screenshots, or chat messages. Treat them as credentials even when you are working in a test environment.

Inspecting localStorage and sessionStorage

Expand the relevant origin and inspect both stores separately. Values are strings, so an object may appear as serialized JSON rather than a native object. If parsing fails, copy the value into a local formatter or a controlled development environment and check for truncated, double-encoded, or outdated data. A utility such as a JSON and API payload debugging workflow can help when stored values contain encoded payloads, but do not submit secrets to third-party tools.

Use the console to verify behavior with small, non-sensitive test values:

localStorage.setItem('debug-preference', JSON.stringify({ theme: 'dark' }));
JSON.parse(localStorage.getItem('debug-preference'));
sessionStorage.setItem('debug-session', 'test-value');

Check application code for assumptions about a missing key. getItem() returns null when a key is absent, while a present key may contain the string "null", an empty string, or malformed JSON. Those cases require different handling.

Inspecting IndexedDB

Expand the origin, database, and object store in DevTools. Review database version, store names, indexes, and representative records. If records do not appear, check whether the application has completed its asynchronous transaction before you inspect the database. Also look for upgrade errors: a schema change that fails can leave an application using an older structure or repeatedly attempting a migration.

For offline features, compare IndexedDB records with network responses and any in-memory cache. A stale screen may not indicate stale IndexedDB data; a service worker, framework cache, or application state layer may be serving an older result. Use the web performance debugging workflow when storage symptoms appear alongside cached JavaScript or asset changes.

Cadence and checkpoints

Storage debugging is most useful as a recurring release check rather than a one-time cleanup task. Add the following checkpoints to a monthly or quarterly review, and repeat them after changes to authentication, routing, caching, browser support, or data schemas.

  1. Before a release: Document the keys, cookies, and databases the feature is expected to create. Note whether each value is temporary, persistent, user-specific, or safe to remove.
  2. During a release candidate test: Test a first visit, a returning visit, a logout, a second tab, a refreshed page, and an upgrade from an older application version.
  3. After deployment: Recheck storage after cache-busting or asset changes. Confirm that old preferences do not break new code and that schema migrations complete.
  4. When a browser changes: Re-run tests if a browser update, privacy setting, embedded context, or partitioning behavior could affect storage access.
  5. When support reports stale state: Capture the exact origin, browser context, storage entries, request sequence, and reproduction steps before clearing everything.

Keep a compact test record for each issue:

Test case: Logout removes client state
Environment: browser/version, operating system, origin
Starting state: signed-in account, existing cookie and local data
Action: select Logout, then refresh and open a new tab
Expected: protected request is rejected; user-specific data is absent
Observed: describe screen, request, and storage differences
Storage checked: key names, cookie attributes, database records
Reproduction: steps, frequency, and whether a clean profile changes it

For API-related symptoms, pair storage observations with request details such as method, URL, status, response, and authorization behavior. A REST API testing workflow helps separate a client-side state problem from a server response problem.

How to interpret changes

A missing value has several possible explanations. It may have expired, been removed by logout code, been written under another origin, been blocked by an attribute or context rule, or never been written because an earlier request failed. Start by comparing timestamps and the order of events rather than immediately clearing all data.

Stale preferences: Check whether the application changed the key name, JSON shape, or default value. Add a version field to structured preferences when migrations are likely, and remove or transform old values deliberately.

Authentication appears lost: Inspect cookie scope and expiration, then compare the browser's outgoing request with the server's response. Do not rely on localStorage alone as proof of an authenticated session; the server may use a cookie or another mechanism as the authority.

Logout is incomplete: Verify that logout clears every user-specific store used by the feature, including IndexedDB records and cached application state. Also check that cookie deletion uses matching scope attributes. A client cannot reliably delete a cookie it cannot access, and a cookie can remain if the deletion scope does not match the original.

Tabs disagree: Determine whether the state is in sessionStorage, localStorage, IndexedDB, memory, or a service worker cache. Test the application's synchronization mechanism instead of assuming that every storage API broadcasts changes in the same way.

Clearing storage fixes the problem: Treat that result as evidence, not a solution. Narrow the reset to the affected origin, key, database, or cookie when possible. Then identify whether the root cause is a migration, invalid serialization, incorrect expiration, failed cleanup, or stale asset.

When to revisit

Return to this guide on a monthly or quarterly cadence for active applications, and immediately after changes that can alter client state. The highest-value triggers include an authentication redesign, a new subdomain, a change to cookie attributes, a localStorage key migration, an IndexedDB schema upgrade, a service worker update, a new embedded integration, or a significant browser privacy or storage behavior change.

At each review, confirm that DevTools still exposes the relevant storage views, repeat the core test cases, and update your internal storage inventory. Browser interfaces and limits can change, so avoid hard-coding assumptions about capacity, partitioning, private browsing, or cross-context access. Check the current browser documentation when a result differs from your established baseline.

For the next debugging session, take these practical steps:

  1. Reproduce the issue without clearing data.
  2. Record the origin, storage type, exact key or record, value shape, scope, and lifetime.
  3. Compare expected and observed values across a fresh visit, reload, logout, and second tab.
  4. Inspect Network requests and application logs to find the writer and reader.
  5. Clear only the affected data, repeat the test, and document whether the behavior changes.
  6. Turn the result into a regression test and schedule the next storage review.

Keeping this small inventory current turns browser storage from hidden state into observable application data. That makes frontend debugging more precise, protects authentication information, and gives each release a clear way to verify that preferences, sessions, and offline records still behave as intended.

Related Topics

#browser-devtools#cookies#localstorage#sessionstorage#indexeddb#frontend-debugging
C

Clicky Live Editorial Team

Developer Tools Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.