What's a Cookie?

You can think of a cookie like a movie theater ticket. You can go to the theater and obtain a ticket for a later showing from the ticket booth. You can then leave the theater, come back, buy some popcorn, and do anything else you'd like. When you're ready to see the movie, you present your ticket to the ticket-taker. The ticket-taker doesn't know how, when, or why you purchased the ticket, but as long as you have it, the ticket-taker will let you into the theater. The ticket entitles the bearer to admission to a later show.

An HTTP cookie is simply an information packet that the CGI program asks the browser to hold on to. The packet can be reclaimed at any time by another CGI program or the same program. Cookies are even passed ...

Get Sams Teach Yourself Perl in 24 Hours 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.