Browsers store sessions, preferences and offline data in several places. Knowing where to look makes state-related bugs easier to reproduce.

Storage types

TypeTypical useLifetime
CookieSession ID, preferencesSession or set expiry; sent with matching requests.
localStoragePersistent browser preferencesUntil cleared.
sessionStorageTemporary tab stateUntil the tab or session ends.
IndexedDBStructured or offline application dataUntil cleared.
Cache StorageResponses used by service workersManaged by the application or browser.
HTTP cacheReusable network responsesControlled by response headers and browser policy.

Cookies

In DevTools, open Application → Storage → Cookies. Check name, value, domain, path, expiry and these flags:

  • Secure: cookie is sent over secure connections.
  • HttpOnly: JavaScript cannot read the cookie.
  • SameSite: controls when cross-site requests include it.
Security: never copy authentication cookie values into tickets or screenshots.

Web storage

// Inspect localStorage sessionStorage // Read and change localStorage.getItem('theme') localStorage.setItem('theme', 'dark') localStorage.removeItem('theme') // Clear all values for this origin localStorage.clear()

Storage is scoped by origin. Similar staging URLs may not share values.

IndexedDB and cache

Use the Application panel to browse IndexedDB object stores and Cache Storage entries. In Network, enable Disable cache while DevTools is open to compare fresh requests. Use Clear site data for a clean-state test.

Common test scenarios

First visit

Clear site data and verify defaults, consent and onboarding.

Persistence

Reload, close the tab and restart the browser. Confirm the correct state survives.

Logout

Verify session data is removed and protected pages cannot be reopened.

Multiple tabs

Change state in one tab and observe whether another updates correctly.

Corrupt or old data

Edit or remove values and verify safe recovery.

Quota and offline

Test storage failure, cached content and reconnection.

  • Test with storage blocked or cookies disabled where supported.
  • Check expiry and clock-related behaviour.
  • Verify one user cannot see another user's cached data.
  • Confirm application updates migrate or discard old stored data safely.

Useful links