Cookies was the mechanism used to store client-side information earlier. But a cookie can only store up to 4 KB of data, which is sent to the server with every single request. Web Storage is the client-side storage standard introduced with HTML5. It has two types: Local Storage and Session Storage . Data stored in Session Storage is available till the user's session is active, and is lost once the session ends. Local Storage data is persisted across sessions. This recipe shows you how to use Local Storage and Session Storage.
Copy the full code of this recipe from the
code/11/storage folder. You can launch this code using the URL:
The steps ...