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?
http://www.zdwebopedia.com/TERM/c/cookie.html
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.
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
- 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.
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.
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.
Actually, Chas., what you’re refering to is a cookie monster or cookie bear, 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, which has also been compiled into a book and published as “The New Hacker’s Dictionary”.
(also see the entries for cookie and magic cookie)