IT lexicon › Web › sessionStorage

sessionStorage

Web På svenska → Updated: 2026-05-25

Browser API for temporary key-value storage per tab. Data is deleted when the tab closes. Distinct from localStorage (persistent) and cookies (sent to the server).

Part of the Web Storage API (HTML5). sessionStorage.setItem('k', 'v') + getItem + removeItem. Values are always strings (objects must JSON.stringify). Quota typically 5–10 MB. Same-origin policy applies. Major differences: localStorage persistent + shared across tabs of the same origin. sessionStorage per tab, not shared. cookies sent in HTTP headers, much smaller quota (4 KB). IndexedDB for structured/binary data.

← Back to the lexicon