WEB STORAGE
Web Storage was first described in the Web Applications 1.0 specification of the Web Hypertext Application Technical Working Group (WHAT-WG). The initial work from this specification eventually became part of HTML5 before being split into its own specification. Its intent is to overcome some of the limitations imposed by cookies when data is needed strictly on the client side, with no need to continuously send data back to the server.
The most modern edition of the Web Storage specification is its second edition. The two primary goals of the Web Storage specification are:
- To provide a way to store session data outside of cookies.
- To provide a mechanism for storing large amounts of data that persists across sessions.
The second edition of the Web Storage specification includes definitions for two objects: localStorage
, the permanent storage mechanism, and sessionStorage
, the session-scoped storage mechanism. Both of these browser storage APIs afford you two different ways of...