Summary

Cookies are an advanced JavaScript feature and can add a lot of functionality to your site. In addition to setting up a shopping cart, you can use cookies to keep track of when and how often a visitor comes to your site and to save customization preferences visitors might set. If you've thoroughly grasped this chapter, you now know:

  • What cookies are

  • How to set a basic cookie

  • How to make a cookie last after the user has turned off the computer

  • How to control which pages can read your cookie

  • How to store more than one piece of information in a cookie

  • How to set and read more than one cookie

  • How to create a separate JavaScript file that other HTML files can include

  • Where to find JavaScript cookie libraries

  • How to build a complex application using ...

Get The Book of JavaScript, 2nd 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.