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 ...

Get HTML5 Data and Services Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.