STORE DATA USING THE WEB STORAGE API
There are several different ways to store data in the Web Storage API. The recommended way is by using the setItem() method on the intended storage interface:
localStorage.setItem(key, string); sessionStorage.setItem(key, string);
Because the storage interface emulates an associative array, the following code can be used instead, ...