Sessionstorage, Localstorage is provided by the Web Storage API provided by HTML5 to avoid unnecessary data transfer between browsers and servers.
Sessionstorage, Localstorage, and cookies are data stored on the browser side.
the difference between the three:
Cookies:
1. Limited storage of each domain name (typically 4k)
2. Limited storage of all domain names
3. Will follow the request to be sent to the server
4. There is a limit to the number of different browsers, a domain name under the number of cookies is limited, and the number of restrictions may not be the same
Sessionstorage:
1. When the browser window is closed, the sessionstorage will be destroyed .
2. Large storage capacity (generally larger than localstorage storage capacity)
Localstorage:
1. Permanently save on client
2. The storage capacity of a single domain name is large (typically 5M)
3. Unlimited number of total