O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required