Reference

Session Storage glossary

Shared vocabulary for this workspace. Lessons stick to these meanings.

Web Storage
Collective name for localStorage and sessionStorage: synchronous string key/value maps with small practical limits (~few MB). Exposed on Window only — not available in workers.
sessionStorage
Web Storage area partitioned by origin and tab (top-level browsing context). Survives reloads and restores in that tab; cleared when the tab/window is closed. Same-origin iframes in the tab share it; other tabs do not.
localStorage
Web Storage area partitioned by origin only. Persists across browser restarts until cleared. Shared by all tabs of that origin.
Page session
MDN’s term for the lifetime of sessionStorage data in a tab: created when the document is loaded in that tab, kept for reloads/restores while the tab stays open, destroyed when the tab closes.
Storage interface
The object returned by sessionStorage / localStorage: getItem, setItem, removeItem, clear, key, length. Keys and values are always strings.
Origin-scoped
Storage is isolated to a site origin (scheme + host + port). Other origins cannot read your Web Storage. (sessionStorage adds a second partition: the tab.)
Client storage
Data kept in the browser for an origin — not the same as “source of truth on the server.” Includes memory, Web Storage, Cache API, OPFS, IndexedDB, cookies, etc.
storage event (StorageEvent)
Fired on a window when a storage area it can access is changed by another document. For localStorage, other same-origin tabs hear it. For sessionStorage, only other same-origin documents in the same tab (e.g. iframes) — not other tabs. The document that made the change does not receive its own event.
Opener copy
When a page has an opener (e.g. opened via window.open), the new page’s sessionStorage is initially a copy of the opener’s. After that they are separate: changes do not sync. Closing either tab ends only that tab’s session data.
QuotaExceededError
DOMException thrown when setItem cannot store the value (quota full, or storage disabled). Always catch write failures; do not assume infinite space.
IndexedDB
Async, large, structured client database. Prefer for durable app data beyond tiny strings. Contrast: Web Storage is sync, string-only, small.
Cache Storage API
Store for Request/Response pairs (HTTP resources). Wrong default for arbitrary UI wizard state.
OPFS
Origin Private File System — file-shaped bytes. Wrong default for a few string flags.
Small name/value data often sent on HTTP requests. Fine for limited auth patterns; wrong for bulk client state (bloats every request).