Hour 21. Web Storage in HTML5

What You’ll Learn in This Hour:

• How to use local storage

• How to detect local storage support

• When to use local storage versus cookies

• How to add local databases using Web SQL and Indexed DB

• How to build an application that uses local storage

Before HTML5 the only way you could store information was either by adding it to the DOM (Document Object Model) or using cookies. But both have drawbacks.

Storing data in the HTML is fairly easy to do but it requires JavaScript, and it can only store data as long as the browser is open and on the application. As soon as the user’s session ends, that data is lost. Plus, data that is stored in the HTML is visible to anyone.

Cookies are limited to around 4KB of data, ...

Get Sams Teach Yourself HTML5 Mobile Application Development in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.