Glossary

Session storage

Session storage is a browser storage area, exposed to scripts as sessionStorage, that keeps key-value data for one origin in one tab and is cleared when that tab or window is closed.
Also calledsessionStorageWeb Storage

Session storage is the short-lived half of the Web Storage API; local storage is the persistent half. MDN describes its lifetime as a page session that lasts as long as the tab or browser is open and survives page reloads and restores. Storage is partitioned by origin and by tab: opening the same page in a new tab or window starts a new session, unlike session cookies, which are shared across tabs. Closing the tab ends the session and clears the data. Unlike cookies, nothing in session storage is sent to the server with requests; only scripts on the page can read it.

Sites use it for state that should not outlive a visit: the steps of a form, a scroll position, a single-tab checkout, or a flag that a banner was already shown in this tab. Some analytics and testing scripts use it to hold a session identifier.

Legally, the short life changes nothing. Article 5(3) of the ePrivacy Directive covers storing information on, or gaining access to information stored in, the user's device, and the EDPB's Guidelines 2/2023 include web storage in that scope. A sessionStorage key that serves analytics or advertising needs consent just as a cookie would; one that keeps a form working is strictly necessary. A cookie policy should list it alongside cookies, as it would a session cookie.

Put a quiet banner on your website today

Free for one website with every core feature, no card and no trial clock. Upgrade a website to Starter for $3 a month to match your brand with AI and drop the branding, or to Pro for $9 to design it with the AI agent.