Facts Get the app
← All articles
🌐 Internet

Why are website cookies called cookies? The real story

In 1994 a Netscape programmer borrowed an old bit of hacker slang, "magic cookie", to give the web a memory. Here's how the name stuck.

⏱️ 5 min Sources checked
In short
  • πŸͺ Web cookies are named after "magic cookie", an older programmers' term for a small token that one program hands to another.
  • πŸ›’ Netscape engineer Lou Montulli came up with web cookies in 1994 so a website could remember things like a shopping cart.
  • πŸ€ People often say the name comes from fortune cookies, but nobody has shown that it does.

Montulli's answer: an old programmers' joke

You can ask the man who named them. In a 2013 blog post, Lou Montulli wrote: "I had heard the term "magic cookie" from an operating systems course from college." He said the term had "a somewhat similar meaning" to how his invention worked, and that he liked "cookies" for aesthetic reasons.

He also admitted the naming wasn't a big deal at the time: "Cookies was the first thing I came up with and the name stuck." One of the most famous words on the internet was a first draft.

πŸ’‘ Aha

The word you click past on every cookie banner was simply the first name that came to mind.

An aha moment like this every day – in 10 seconds.Facts Β· β˜… 4.8 Β· Free Get the app

Long before the web, programmers used "magic cookie" for a small piece of data passed back and forth between programs. The Jargon File, a long-running dictionary of hacker slang, defines it as "something passed between routines or programs that enables the receiver to perform some operation."

The important part is that the receiver doesn't need to understand what's inside. It just keeps the token and hands it back later, a bit like a coat-check ticket. Web cookies work the same way: a site gives your browser a small piece of text, and your browser sends it back on later visits.

So where did the "cookie" part come from? You'll often read that it's a nod to fortune cookies, which are treats with a message hidden inside. It's a nice image, but no early source backs it up. Even the Jargon File entry doesn't explain where the word came from. The honest answer is that the name goes back to "magic cookie", and the origin of that term is still unclear.

The problem cookies solved: a web with no memory

In the early 1990s, websites forgot you the moment a page finished loading. Every click looked like a brand-new visitor. Montulli described the problem this way: "The problem in 1994 was a lack of mechanisms to identify a user individually."

That was a real headache for online shopping. A team at Netscape was building a shopping server and, in Montulli's words, "needed to build shopping cart functionality into the server." Without some way to recognise you between pages, the site couldn't remember what you had put in your cart.

Cookies solved it neatly. According to Guinness World Records, the first cookies were used on 13 October 1994, on Netscape's own website, to tell whether a visitor had been there before. Netscape released its browser that fall, and Montulli says it was the most popular browser in the world within a year.

From shopping carts to tracking

In February 1997, cookies got an official technical standard, RFC 2109, co-written by Montulli and Dave Kristol of Bell Labs. Its definition is plain: "we will use the term cookie to refer to the state information that passes between an origin server and user agent." The same document already warned that "users must have control over sessions in order to ensure privacy."

That warning turned out to matter. When a page loads content from other companies, like ads or embedded widgets, those companies can set their own cookies too. These are called third-party cookies, and Montulli wrote that they "represent a new way in which users can be tracked across multiple web sites." He added: "Tracking across websites was certainly not what cookies were designed to do."

πŸ’‘ Aha

A tool built to remember your shopping cart ended up helping advertisers follow you around the web.

Netscape decided not to block third-party cookies. Montulli's reasoning was that tracking by visible companies could be kept in check by public pressure, while blocking cookies would push tracking into less visible methods. Looking back in 2013, he wrote: "Today, I still believe that it was the correct decision."

All those pop-ups exist mainly because of European law. In November 2009, the EU amended its ePrivacy Directive with Directive 2009/136/EC. The new rule says that storing information on a user's device is only allowed if the user "has given his or her consent" after receiving "clear and comprehensive information" about why.

There is an exception for storage that is "strictly necessary" to provide a service the user asked for, which is why a shopping cart cookie, the original use, generally doesn't need your permission. Ad-tracking cookies do. Thirty-some years on, Montulli's small token is the reason websites ask before they remember you.

πŸ”Read the banner's purposes. The EU rule ties consent to clear information about what cookies are used for, so the banner should tell you what you're agreeing to.
πŸ›’Expect necessary cookies to stay. Cookies that are strictly needed for something you asked for, like a cart or a login, fall under the exception and don't need consent.

Frequently asked questions

Who invented web cookies?

Lou Montulli, a programmer at Netscape, came up with them in 1994. Guinness World Records dates their first use to 13 October 1994, on Netscape's website.

Are cookies named after fortune cookies?

Not directly. Montulli named them after the programmers' term "magic cookie". Some people link that older term to fortune cookies, but there's no solid evidence for it.

What is a third-party cookie?

It's a cookie set by a company other than the site you're visiting, usually through an embedded ad or widget. Because the same company can appear on many sites, it can recognise you as you move around the web.

Why do websites ask me to accept cookies?

EU law since 2009 says sites need your consent before storing non-essential information, such as tracking cookies, on your device. Cookies that are strictly necessary for a service you asked for are exempt.

Sources

Guinness World Records: First use of cookies on the internet

European Parliament and Council (via legislation.gov.uk): Directive 2009/136/EC, Article 2

Kristol & Montulli (1997), IETF: RFC 2109: HTTP State Management Mechanism

Lou Montulli (2013), personal blog: The reasoning behind Web Cookies

The Jargon File (Hacker's Dictionary): magic cookie

πŸͺ Finished!

In the app, this would earn you a sticker.

Download on the App Store
Keep readingAll articles β†’