image

© Risto Viita/Shutterstock

chapter25

Utilizing Web Storage

FOR YEARS, COOKIES WERE the only option available to most Web developers for storing temporary information. Using a cookie, a developer could store up to 4KB of data. A website might, for example, use a cookie to track the items in a your shopping cart from one site visit to the next or track your preferences while traversing a site. HTML 5 expands beyond the storage capabilities that cookies provide to allow session-based storage and long-term storage. The session-based storage exists until you leave the site or close the window. In contrast, the long-term storage persists until you or ...

Get Introduction to Web Development Using HTML 5 now with the O’Reilly learning platform.

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