O'Reilly logo

JavaScript: Visual QuickStart Guide, Eighth Edition by Dori Smith, Tom Negrino

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

9. JavaScript and Cookies

In This Chapter

Baking Your First Cookie 221

Reading a Cookie 225

Showing Your Cookies 226

Using Cookies as Counters 228

Deleting Cookies 231

Handling Multiple Cookies 233

Displaying “New to You” Messages 235

In Web terms, a cookie is a unique nugget of information that a Web server gives to your browser when the two first meet and which they then share with each return visit. The remote server saves its part of the cookie and the information it contains about you; your browser does the same, as a plain text file stored on your computer’s hard disk.

As a JavaScript author, you can do many useful things with cookies. If your site requires registration, you can set cookies to store your readers’ user names and passwords ...

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