Hour 10. JavaScript and Cookies

What You’ll Learn in This Hour

• What cookies are

• All about cookie attributes

• How to set and retrieve cookies

• About cookie expiration dates

• How to save multiple data items in a single cookie

• Deleting cookies

• Escaping and unescaping data

• Limitations of cookies

Something that the JavaScript techniques that you have seen so far can’t do is transfer information from one page to another. Cookies provide a convenient way to give your web pages the means to store and retrieve small pieces of information on a user’s own computer, allowing your website to save details such as a user’s preferences or dates of his or her prior visits to your site.

In this hour you learn how to create, save, retrieve, and delete ...

Get Sams Teach Yourself JavaScript™ in 24 Hours, Fifth Edition 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.