O'Reilly logo

JavaScript™ 1.5 by Example by Kathie Kingsley-Hughes, Adrian Kingsley-Hughes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required