Local Storage is an alternative to cookies and it lets JavaScript store data in the browser more securely than cookies. There is also a smaller counterpart to local storage called session storage, which stores data until the browser window is closed instead of indefinitely. Collectively, the two are known as Web Storage. Local Storage is different from cookies in which it allows 5MB of data and the data is stored in the browser instead of the webpage server (so less data transferred). However, data can only be stored as a string.
See the below links for learning about Local Storage:
You can utilise localStorage like this:
if (typeof(Storage) !== "undefined") {//detect for support
localStorage.setItem("name", "value");//sets item
localStorage.name = value;//less recommended approach to set item
localStorage.getItem(name);//gets item value
localStorage.name;//gets item value
localStorage.removeItem(name)//only way to remove item
sessionStorage.setItem("name", "value");//set item temporarily
}
Note: sessionStorage is used in the same way as localStorage but the word localStorage is replaced by the word sessionStorage.