Home >Web Front-end >H5 Tutorial >Recommended articles about localStorage and sessionStorage
1. Overview localStorage and sessionStorage are collectively called Web Storage, which allows web pages to store data on the browser side. The data saved by sessionStorage is used for a browser session. When the session ends (usually the window is closed), the data is cleared; the data saved by localStorage exists for a long time. The next time you visit the website, the web page can directly read the previously saved data. data. Except for the different storage periods, the properties and methods of the two objects are exactly the same. They are much like an enhanced version of the cookie mechanism and can use much larger storage space. Currently, the storage limit per domain depends on the browser, and is 2.5MB for Chrome, 5MB for Firefox and Opera, and 10MB for IE. Among them, Firefox's storage space is determined by the first-level domain name, while other browsers do not have this limitation. That is, in Firefox, a.example.com and b.example share 5MB of storage space. In addition, like cookies, they are also subject to same domain restrictions. The data stored in a web page is only
1. Specific analysis of localStorage and sessionStorage of HTML5 local storage
Introduction: The data saved by sessionStorage is used for a session of the browser. When the session ends (usually the window is closed), the data is cleared; the data saved by localStorage exists for a long time. When visiting the website once, the web page can directly read the previously saved data. Except for the different storage periods, the properties and methods of the two objects are exactly the same.
Introduction: Talk about Local storage pros and cons Cookie, localStorage, sessionStorage
Introduction: This article mainly introduces the basic usage of HTML5 local storage localStorage, sessionStorage, traversal operations, exception handling, etc. Friends in need can refer to it
[Related Q&A Recommendations]:
Why do localStorage and sessionStorage belong to the category of html5, but why do IE8 support them?
The above is the detailed content of Recommended articles about localStorage and sessionStorage. For more information, please follow other related articles on the PHP Chinese website!