Cookie
Noun · Development
Definitions
Cookie is a small piece of data that a web server sends to a user's browser, which stores it and sends it back with subsequent requests to the same server. Cookies enable stateful interactions on the inherently stateless HTTP protocol. They are used for session management (keeping users logged in), personalization (remembering preferences and language settings), and tracking (recording user behavior across pages for analytics and advertising). Cookies have a name, value, domain, path, expiration date, and security flags like Secure (HTTPS only) and HttpOnly (inaccessible to JavaScript, protecting against XSS attacks). Third-party cookies, set by domains other than the one the user is visiting, have been widely used for cross-site tracking and targeted advertising but are being phased out by major browsers due to privacy concerns. Alternatives like localStorage, sessionStorage, and server-side sessions offer different tradeoffs for web state management.
In plain English: A tiny file that websites save in your browser to remember who you are, what you like, or that you are logged in.
Example: "Every website now asks you to accept cookies, which is like a burglar asking if they can case your house."
Etymology
- 1994
- Lou Montulli at Netscape invents the HTTP cookie to enable stateful sessions on the stateless web.
- 1997
- RFC 2109 formalizes cookie behavior. Third-party tracking cookies begin raising privacy concerns.
- 2018
- GDPR takes effect, requiring explicit consent for non-essential cookies. Cookie consent banners appear across the web.
- 2020s
- Google announces plans to phase out third-party cookies in Chrome, driving the industry toward alternative tracking methods.
Origin Story
The Baked Good That Tracks Your Every Click
An HTTP cookie is a small piece of data sent by a web server and stored on the user's browser, allowing the server to remember information across page loads. The term was coined by Lou Montulli, a 23-year-old programmer at Netscape Communications, in 1994. Montulli was solving a practical problem: the web's HTTP protocol was stateless, meaning each page request was independent with no memory of previous requests. This made shopping carts, login sessions, and user preferences impossible. Montulli borrowed the concept of a 'magic cookie' from Unix programming, where it referred to an opaque token passed between programs. He implemented cookies in Netscape Navigator, and the feature shipped without much fanfare or public attention. This quiet introduction became controversial in retrospect. In 1996, the Financial Times published an article revealing that cookies could track users across websites, sparking the first major internet privacy debate. Despite decades of controversy, regulation (including the EU's GDPR cookie consent requirements), and technical alternatives, cookies remain fundamental to the web. Third-party tracking cookies have been gradually phased out by browsers, with Google Chrome finally deprecating them in the mid-2020s, but first-party cookies for session management and preferences persist.
Coined by: Lou Montulli
Context: Netscape Communications, 1994
Fun fact: Lou Montulli also invented the blink tag, one of the most hated HTML elements in web history. He later said creating it took about ten minutes and he never expected anyone to actually use it.