Browser Storage Explained: Local Storage and Session Storage
Why can a website remember a setting on this device? Browser storage can keep small pieces of site data locally.
1:47 · No narration: the video shows each step as text on screen, and every step is written out below, with buttons that jump the video to it.
Prefer YouTube? Watch this video on our YouTube channel (opens in a new tab).
The six points in the video
This is a silent video. The headings, explanations and labels below reproduce the information on screen.
-
Step 1: Start with key and value pairs
Web Storage lets site scripts save simple named values.
On-screen labels: Named key; Stored value; Site script access.
-
Step 2: Local storage can persist
Data can remain when the browser is closed and reopened.
On-screen labels: Return visit; Saved preference; Persistent local data.
-
Step 3: Session storage follows the tab
It is separated by origin and tab, and ends when that tab closes.
On-screen labels: Tab context; Same origin; Tab closes.
-
Step 4: It is not automatically a backup
People can clear site data and storage may be unavailable.
On-screen labels: Cleared browser data; Storage limits; Missing saved setting.
-
Step 5: Keep sensitive data protected
Script-readable local storage is unsuitable for secrets.
On-screen labels: No secret passwords; No sensitive records; Secure system design.
-
Step 6: Test a fresh browser state
A site should handle missing preferences sensibly.
On-screen labels: No saved data; Useful default; Records stored safely.
A practical check for your business
Check which browser storage holds the information the site needs. Test what happens in another browser, after clearing stored data and when storage is unavailable; avoid treating a local browser copy as the business record.
Sources and further detail
Common questions
Why can a website remember a setting on this device?
Browser storage can keep small pieces of site data locally. Keep local preferences separate from important records.
Go further
More video tips
All 205 videos →
Website Software Updates: 6 Checks for a Sensible Maintenance Plan
6 website maintenance checks.
Keyboard Navigation: 6 Practical Website Checks
Try the customer journey.