The Web Storage storage mechanism is an improvement to the cookie storage mechanism in HTML4, and because of the many drawbacks of the cookie mechanism, HTML5 no longer uses it and instead uses the improved Web Storage storage mechanism. The local database is a new feature in HTML5, which can be used to establish a database on the client, and the data that must be saved on the server can be saved locally on the client, which greatly reduces the burden on the server.
Html4cookie Existing problems:
Size: The size of the cookie is limited to 4KB;
Bandwidth: A cookie is sent along with an HTTP transaction, so it wastes a portion of the bandwidth used to send the cookie;
Complexity: It is difficult to manipulate cookies correctly.
One, the Web storage is divided into sessionstorage and localstorage two kinds.
1, Sessionstorag
Local storage and local database in HTML5