View Full Version : Why are computer cookies called cookies?

04-02-2001, 08:55 PM
Those ever-present cookies that you get every time you're on the Internet....Why are they called cookies? Was that just an arbitrary selection, or is there more to it?

04-02-2001, 10:25 PM

The name cookie derives from UNIX objects called magic cookies. These are tokens that are attached to a user or program and change depending on the areas entered by the user or program. Cookies are also sometimes called persistent cookies because they typically stay in the browser for long periods of time.

04-02-2001, 10:30 PM
I should have mentioned the above text was a direct quote from the link. I'll be more clear this time:
[quote] from http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?magic+cookie
magic cookie
1. Something passed between routines or programs that enables the receiver to perform some operation; a capability ticket or opaque identifier. Especially used of small data objects that contain data encoded in a strange or intrinsically machine-dependent way. E.g. on non-Unix operating systems with a non-byte-stream model of files, the result of "ftell" may be a magic cookie rather than a byte offset; it can be passed to "fseek", but not operated on in any meaningful way. The phrase "it hands you a magic cookie" means it returns a result whose contents are not defined but which can be passed back to the same or some other program later. [/url]

04-02-2001, 10:38 PM
My first inclination, upon seeing the words Magic Cookie, was to consider the cookies in Alice In Wonderland.

However, after seeing this next definition, I'm more inclined to believe that the sequence started with Fortune Cookie.

Many people remember the Fotune Cookie program from large Unix systems. The program had to have the equivalent of a modern cookie to know which joke in the list you had seen, since it would give you a new one at each login. Sort of like the Windows Start-up Tip file does now.

from http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?fortune+cookie
fortune cookie
(WAITS, via the Unix "fortune" program) A quotation, item of trivia, joke, or maxim selected at random from a collection (the "cookie file") and printed to the user's tty at login time or (less commonly) at logout time.

There was a fortune program on TOPS-20.

04-02-2001, 11:03 PM
Ah, there was a long thread about this on usenet in a tech newsgroup a while ago. I came up with the best answer.

The first appearance of cookies in computer folklore was described in the famous book "Computer Lib" by Ted Nelson. He described an anecdote, possibly apocryphal, but widely known amongst computer geeks.

As the story goes, a large corporate mainframe accounting system was written and maintained by a very clever programmer. Once he left the company, odd things started happening. Every once in a while, the system would completely halt, and the console would display a message: "Gimme a cookie." The system would not return to normal operations until the operator typed "cookie" and then all was well.
The new administrators spent much effort trying to debug the code, but no matter how they tried, they could not eradicate this weird behavior, it was buried deeply and obscurely in the code and could not be eliminated without totally rewriting the programs from scratch. It was finally decided it was better to leave the code in place, document the cookie question, and train operators to give the machine a cookie. This was the first citation anyone could provide that showed a challenge/response related to cookies.

Obviously the "gimme a cookie" question was inspired by the Sesame Street Cookie Monster. I don't know if this story is true or not, but "Computer Lib" was widely read and certainly this story was known to later programmers who adopted the term.

Robot Arm
04-02-2001, 11:49 PM
Actually, Chas., what you're refering to is a cookie monster (http://tuxedo.org/jargon/html/entry/cookie-monster.html) or cookie bear (http://tuxedo.org/jargon/html/entry/cookie-bear.html), and I haven't seen any reference to "cookie" deriving from the same source.

The best place I know of for answers about computer jargon, history and folklore is The Jargon File (http://tuxedo.org/jargon/html/index.html), which has also been compiled into a book and published as "The New Hacker's Dictionary".

(also see the entries for cookie (http://tuxedo.org/jargon/html/entry/cookie.html) and magic cookie (http://tuxedo.org/jargon/html/entry/magic-cookie.html))

Send questions for Cecil Adams to: cecil@straightdope.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Copyright 2018 STM Reader, LLC.