///////////////////////////////////////
//The Web storage API (see the related W3C specification) introduces "two related mechanisms, similar to HTTP session cookies, for storing structured data on the client side".
// Full Documentation : https://www.w3.org/TR/webstorage/
//Indeed, Web Storage provides two interfaces - sessionStorage and localStorage //- whose main difference is data longevity. This specification defines an API //for persistent data storage of key-value pair data in Web clients.
//With localStorage the data will remain until it is deleted, whereas with //sessionStorage the data is erased when the tab/browser is closed.
//For convenience, we will mainly illustrate the localStorage object. Just //change "local" to "session" and it should work (this time with a session //lifetime).key value pairs
//Simple key-value stores, one per domain (following the same origin policy)!
//localStorage is a simple key-value store, in which the keys and values are //strings. There is only one store per domain. This functionality is exposed //through the globally available localStorage object. The same applies to //sessionStorage.
//You can view LocalStorage/SessionStorage by:
// WebDevTools -> Application -> LocalStorage
// WebDevTools -> Application -> Session Storage
// ie for codepen we ll have:
// http://codepen.io (standalone mode)
// https://s.codepen.io (edit mode)
localStorage.lastName = "Bunny";
localStorage.firstName = "Bob"
console.log(localStorage);
var first = localStorage.firstName;
var last = localStorage.lastName;
console.log(first, last)
JS.WebStorage.LocalStorage.SessionStorage
-----------------------------------------
A [Pen](https://codepen.io/Onlyforbopi/pen/bmGvYP) by [Pan Doul](https://codepen.io/Onlyforbopi) on [CodePen](https://codepen.io).
[License](https://codepen.io/Onlyforbopi/pen/bmGvYP/license).