Building Blocks

Cookie

How websites remember you

TL;DR

A tiny file websites save on your computer to remember who you are. That's why Amazon remembers your cart and why ads stalk you across the internet.

The Plain English Version

You walk into your favorite coffee shop. The barista sees you and says, "The usual?" They remember you. Now imagine if every single time you walked in, they had no idea who you were. "Welcome! What's your name? What do you like? Do you have an account?" Every. Single. Time. That would be exhausting.

The internet has this problem. Websites are stateless — they have amnesia by default. Every time you visit, they don't know who you are. Cookies fix this. A cookie is a tiny text file a website stores on your computer that says, "Hey, this is the same person from before. They're logged in. Their cart has 3 items. They prefer dark mode."

There are two kinds of cookies. First-party cookies are helpful — they keep you logged in and remember your preferences. Third-party cookies are the creepy ones — they're from advertisers tracking you across different websites so they can show you eerily specific ads. That pair of shoes you looked at once? Third-party cookies are why they follow you everywhere for the next two weeks.

Why Should You Care?

Because cookies control a lot of your online experience, and understanding them helps you manage your privacy. Those "accept cookies" banners? Now you know what they're asking. Clearing cookies logs you out of everything because the websites lose their memory of you. And those "personalized ads"? That's cookies (and their replacements) at work.

The Nerd Version (if you dare)

HTTP cookies are key-value pairs stored by the browser per domain, sent with every request via the Cookie header. Attributes include Expires/Max-Age (lifetime), Domain/Path (scope), Secure (HTTPS only), HttpOnly (no JavaScript access), and SameSite (CSRF protection). Session cookies exist only in memory; persistent cookies survive browser closure. Third-party cookie deprecation is pushing adoption of alternatives like the Privacy Sandbox, server-side tracking, and first-party data strategies.

Related terms

Like this? Get one every week.

Every Tuesday, one AI concept explained in plain English. Free forever.

Want all 75 terms in one PDF? Grab the SpeakNerd Cheat Sheet — $9