Talk about these two properties Sessionstrong and Localstorage are HTML5 new point attributes that are used to record some data in the browser.
The difference between the two sessionstrong the stored data is temporary, and when the browser is switched off, the stored data will be erased.
Localstorage stored data is long-term, when the browser is turned off, the stored data will be saved in the browser.
The data stored in the database can be found in the resources of the browser.
With these two properties, we can do a lot of things, use it flexibly, and don't need to rely on cookies.
You must love your work, the Web, only the things you like. Only then will have the happiness, will progress.
Technical section:
To store data in a browser:
Localstorage.setitem ("heName01", "Jay Chou");
Sessionstorage.setitem ("HeName02", "JJ Lin");
Take the storage to the data and use it:
var heName01 = Localstorage.getitem ("Hename");
var heName02 = Sessionstorage.getitem ("Hename");
Console. log (heName01);//Jay Chou
Console. log (HENAME02);//JJ Lin
To erase the stored data in the browser:
Localstorage.removeitem ("heName01");
Sessionstorage.removeitem ("heName02");
Flexible use of Html5_sessionstrong and Localstorage