What Are Cookies?

Cookies are little bits of information a site leaves on the hard drive of visitors. Because the information ends up on the hard drive, it remains after the user leaves the current page and even after the computer is turned off. You'll find this feature extremely useful when you want to remember information about a user each time he or she visits your site.

Google's search window and its cookie

Figure 12-2. Google's search window and its cookie

You can see the cookies saved on your computer by looking for the cookies.txt file for Netscape or the Cookies directory for Internet Explorer. In either case, you'll see a long list of site names, each with a string of text. The ...

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.