Session and local storage
Cookies are a common way to save state from our application at the client side. This might be some checkboxes that were selected or some kind of temporary data, for example, current flow in a wizard app or even a session identifier.
This is a proven method for quite some time, but there are a few use cases where it is just uncomfortable to create cookies and they impose certain limits and overhead that can be avoided.
Session and local storage solve some of the issues with cookies and enable a simple storage of data on the client. In this recipe we will create a simple form that will take advantage of the HTML5 storage API.
Getting ready
In this recipe we will use several images that can be retrieved from the images
folder or you can use your own selection. Additionally since we will use a simulated response from the REST API of a JSON object we need to start a local HTTP server that will serve our static files.
How to do it...
We can start off by creating a form that...