Browser Storage Test

A self-contained page for testing cookies, LocalStorage, SessionStorage, and IndexedDB from browser-side JavaScript.

Storage Inspection

Current values visible to this page.

Cookie string
(empty)
LocalStorage item count 0
SessionStorage item count 0
IndexedDB status Not opened

This file works when opened directly in a browser. For more accurate cookie and storage behavior, test through a local HTTP server such as http://localhost:8000/browser-storage-test.html.

LocalStorage

Persists across browser sessions for this origin.

Key Value Actions

SessionStorage

Persists for this tab or browsing context.

Key Value Actions

IndexedDB

Creates a test database named BrowserStorageTestDB with one object store named records.

Key Value Updated Actions

Testing Notes

Browser storage rules depend on origin, protocol, and privacy settings.

  • HttpOnly cookies cannot be created or read from JavaScript.
  • Secure cookies require HTTPS, except on localhost in some browsers.
  • SameSite=None usually requires the Secure flag.
  • Domain cannot be freely set to unrelated domains.
  • Cookie behavior may differ between localhost, HTTP, HTTPS, and cross-site contexts.
  • Opening this page as a local file can be useful, but a local HTTP server gives behavior closer to a real site.