Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6. Client-Side Data Storage Hacks > Hack 54. Use the WebStorage API to Persist ...

Hack 54. Use the WebStorage API to Persist User Data

Web applications often need a way to store data. With HTML5’s LocalStorage and SessionStorage APIs you have a simple way to store data in an easy-to-use API.

This hack was contributed by Raymond Camden, a senior developer evangelist for Adobe Systems Inc.

Data persistence in the early days of web applications relied on one basic technology: cookies. Although cookies were serviceable, they were burdened by privacy concerns and limitations (in terms of storage size and their impact on network performance). Luckily, HTML5 provides a much-improved way to handle persistent data storage: LocalStorage. Technically called the WebStorage API, most people refer to it as LocalStorage. There is also a corresponding API called SessionStorage that we will discuss later.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint