localStorage and sessionStorage
Widely available since 2018-01-29
The localStorage
and sessionStorage
APIs store data as key-value pairs. While localStorage
persists across sessions, sessionStorage
data is discarded when the page is closed.
Learning resources on MDN
Browser support (view on caniuse.com)
- Chrome 4 Released on 2010-01-25
- Chrome Android 18 Released on 2012-06-27
- Edge 12 Released on 2015-07-29
- Firefox 3.5 Released on 2009-06-30
- Firefox for Android 6 Released on 2011-08-16
- Safari 4 Released on 2009-06-08
- Safari on iOS 3.2 Released on 2010-04-03
Specifications
- Storage Standard, from Storage Workstream (WHATWG).