"Cookies" are a user-facing computing construct. They are codified in many technical specifications, including the earliest reference in an HTTP spec, RFC 2109, published February 1997.

Many claim the use in HTTP followed from UNIX "magic cookies." Eric Raymond provided a definition of what a "magic cookie" is:

Something passed between routines or programs that enables the receiver to perform some operation; a capability ticket or opaque identifier [...]


But why did the UNIX community start using the phrase "cookie" to begin with? Is it because you put cookies into a jar, and take them out? When did this whole thing begin? Does anyone have a citation of the first usage?

  • 1
    $\begingroup$ (It certainly was in use on usenet comp.unix back in the '80s. The jargon file 2.1 is from 1990? Thought it was older.) $\endgroup$ – greybeard Sep 11 '20 at 20:23

According to the Wikipedia article on magic cookie, it was used already in 1979 in the manpage of fseek. The talk page of the Wikipedia article on magic cookie discusses questions regarding the origin and meaning of the word. The following quote of Douglas W. Jones from the talk page nicely summarizes it:

Once upon a time, I asked Dennis Ritchie about the origin of the term magic cookie as used in the man page for ftell and fseek in the C library. He said that, so far as he knew, the usage in that man page was a new coinage. That man page is not present in V5 UNIX but it is present in the manuals for V7 UNIX and 4.2BSD. I have quoted the relevant sentence from that manual on the Wikipedia page; the wording makes it clear that the meaning is the same as the contemporary meaning for magic cookie (in the broader sense than HTML cookie). Any speculation about derivation from cookie monsters or LSD cookies seems, at this point, irrelevant compared to tracking down the first use of the term in its modern sense. Douglas W. Jones 21:15, 24 February 2017 (UTC)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.