Saturday 1 February 2020

How cookies were baked into web terminology

Apart from SPAM, the other food item that has made its way into tech terminology is the cookie. Before the internet, cookies only came in biscuit-form, normally containing chocolate chips or fortunes, so how did they become part of day-to-day web vernacular?

Being asked to accept cookies is now a standard part of the web browsing user experience.

To start at the beginning, the word cookie comes from the Netherlands, specifically the word koekje, which simply means as 'little cake', from the Dutch word koek meaning 'cake' and the suffix -je to denote something little. Although there is no historical evidence to connect this to the Scottish cookie, a plain round bun that cropped up in the early 1700s and apparently came from the English word 'cook' with the suffix -ie, the Scottish equivalent of the Dutch -je suffix.

"Koekjes" arrived in the United States with the Dutch West India Company in 1624 and the creation of New Amsterdam, the city now called New York, on the southern tip of Manhattan Island. The spelling had changed to the Anglicised "cookies" by the 1850s, although across the pond in England they were and still are referred to as biscuits from the Old French bescoit and the Latin biscotum meaning 'twice cooked' (bis 'twice' + coctum from coquere 'to cook'), the origin of the Italian biscotti.

The popularity of cookies in the United States continued to rise with the invention of the chocolate chip cookie in 1930 but it was the earlier arrival of the fortune cookie that led to the cookie moving into tech vernacular. It might be a surprise but historical evidence suggests the fortune cookie was a Japanese rather than a Chinese creation and was first sold in the United States by Japanese migrants from the late 1890s to early 1900s. They were later adopted by the Chinese and became a popular after dinner treat in Chinese-American restaurants after the Second World War.

Fortune cookies. Photo by Meritt Thomas on Unsplash

Three decades later, clearly inspired by the fortune cookie, Version 7 of Unix was released in January 1979 with a `fortune` command that would display a joke or saying from a database of quotations when it was run. These were known as fortune cookies or cookie files. Coincidentally the Unix manual would also reference the magic cookie, a token or piece of data that was passed from one program to another, which has led some people to believe it is a reference to fortune cookies.

Despite theories about the origin of the magic cookie being a reference to an LSD-laced cookie or the Cookie Monster, who first appeared on Sesame Street in 1971, the founders of Unix offered an alternative origin. When I emailed Ken Thompson, Brian Kernighan and Doug McIlroy asking where the term came from, they all offered the same response - Robert "Bob" Morris, the Bell Labs cryptographer.

Cryptographer Bob Morris introduced the term 'cookie' to Bell Labs in the 1970s.
Professor McIlroy said the term had been in use in the lab before 1979 and that Morris was the person who introduced cookie into their vocabulary:
"It was usually applied to a very short and enigmatic bit of text. He used the word (cookie) in non-computing contexts too. I do not know whether he coined the usage or picked it up elsewhere. In Bob's usage, "cookie" usually stood alone. I suspect "magic" got attached to it by analogy to the comparable term "magic number", which applies to the data structure at the front of an an a.out file."
Sadly Bob Morris died in 2011, possibly taking the secret to the origin of the magic cookie with him. An unfortunate end to my quest for answers but as with some things in life, sometimes that's just the way the cookie crumbles.

No comments:

Post a Comment

Memes, mimes and genes

Memes have become part of the daily fabric of the internet and social media. It's hard to go a day online without coming across a  Dist...