Example 7—Controlling Cookies

The final example here looks at how you can take control over cookies with JavaScript. Cookies are more widely used on the Web now than ever before to personalize Web content for frequent visitors (not to mention the tracking capability cookies provide, which is useful for marketing and sales purposes!).

Cookies are unique pieces of information a Web site gives the browser. The next time the browser goes to that site, invariably the information contained in that cookie is read. This enables the Web site to remember that you've been there before.

NOTE

The individual bits of information contained in a cookie are, not surprisingly, called crumbs!

JavaScript lets you do some clever things with cookies. They can let ...

Get JavaScript™ 1.5 by Example now with O’Reilly online learning.

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