HTML5 Web Storage – HTML API
HTML5 Web Storage – Session and Local Storage
Web storage specified by W3C.it provide functionality to store data on user machine. This data can be store for both temporary or for permanent needs. Certain browsers also refer to it as ‘DOM Storage’. The advantage of such storage is more control able than traditional cookies. It enables to store a maximum of 5 MB of information per domain.
HTML5 Web Storage: Session storage
The session storage store the data as long as the browser tab or window remains open. This may not be a hard limit, however, because the spec leaves open the opportunity for the browser to keep this data around “during restarts.”
There’s not much to the mechanism. Each document gets a sessionStorage object with a few major functions: setItem, getItem, and clear.
HTML5 Web Storage: Local storage
The real advantages come with access to the localStorage object, which looks quite similar to the sessionStorage object but behaves very differently. Where the sessionStorage forgets, the localStorage remembers. Data is supposed to stick around even after the window closes and the computer shuts down.