Cookie Basics Cookie Editor guide

What Are Browser Cookies? A Plain-English Guide

Cookies are small notes a website asks your browser to keep. What they store, why sites use them, and how to look at yours.

Illustration of a browser storing small labelled notes for different websites

A browser cookie is a small piece of text that a website asks your browser to store and send back on future visits. That is the whole mechanism, no program, no tracking chip, just a name and a value your browser keeps and returns. Cookies are how a site remembers that you chose dark mode, that your language is English, or that you are the same visitor who put three items in a basket yesterday.

Imagine you open a site and switch its theme to dark. The site replies: “browser, please remember theme=dark for me.” Your browser stores that pair. Next time you visit, your browser includes theme=dark in its request, and the site serves the dark theme immediately. Open Cookie Editor on that page and you can see the record yourself, name theme, value dark, which is why a theme preference is the perfect first cookie to inspect.

What cookies are commonly used for

  • Preferences, theme, language, region, and display options you chose.
  • Sign-in sessions, a random session ID that proves you logged in, so you are not asked for your password on every page.
  • Baskets and forms, items you added, or progress through a multi-step process.
  • Consent choices, the answer you gave to the site's cookie banner.
  • Measurement, anonymous or pseudonymous IDs some sites use to count visits (these are the cookies privacy rules focus on).
Cookie kinds at a glance
KindHow long it lastsTypical job
Session cookieUntil the browser closesSign-in state, basket during one visit
Persistent cookieUntil its expiry date (days to months)Preferences, “remember me”, consent choices
First-party cookieSet by the site in your address barAny of the jobs above, for that site
Third-party cookieSet by a different domain embedded in the pageCross-site measurement and embedded content, see the third-party guide

What cookies cannot do

Cookies cannot run code, install anything, or read files from your computer. A cookie is data, not a program, and your browser only sends it back to the domain it belongs to. The real privacy questions are about what values sites store and share, which is why being able to view your own cookies, as this site teaches, is such a useful habit. The difference between session and persistent cookies is covered in Session vs Persistent Cookies.

Cookies, local storage and cache: cousins, not twins

Cookies are the oldest of three ways a site remembers things in your browser, and the only one your browser automatically sends back to the site with every request. Local storage also keeps name-and-value pairs, but the site's own scripts must read it deliberately; nothing is sent automatically. The cache stores whole files (images, scripts) so pages load faster, and it holds no settings at all. This distinction explains a classic puzzle: you delete a site's cookies, yet it still “remembers” you, the preference was in local storage. Cookie Editor manages cookies; your browser's site-data screen manages all three.

Browser storage compared
CookiesLocal storageCache
Sent to the site automatically?Yes, with each requestNo, scripts read it on the pageNo
Typical sizeTiny (a few KB per site)Larger (MBs allowed)Large files
Set an expiry?Yes, or session-onlyUntil removedManaged by the browser
Managed by Cookie Editor?YesNoNo

Follow one cookie through an ordinary day. In the morning you open a news site and pick the dark theme; the site asks your browser to keep theme set to dark for a year. At lunch you sign in to a shop; the site adds a session cookie that means 'this browser is the signed-in one', with no expiry, so it will die when the browser closes unless the shop also sets a longer 'remember me' cookie. In the afternoon an embedded video on a blog sets a cookie from the video company's domain, a third-party cookie, so the company recognises you across sites that embed it. In the evening you clear nothing, change nothing, and yet tomorrow the news site is still dark and the shop has forgotten you: exactly what each cookie's type and expiry predicted.

Why sites do not just remember you on their servers

They often do, for anything tied to an account. But a server cannot recognise a browser it has never met, and most visits are not signed in. Cookies solve the first-contact problem: the browser carries small proofs of earlier visits and presents them automatically. They are also cheap and instant, with no database lookup needed just to know your language. The trade-off is that the data lives on your device, under your control, which is why your browser lets you inspect and delete it, and why a tool like Cookie Editor can show you everything a site is asking your browser to remember.

Cookie or not?
ThingIs it a cookie?Where it lives
Your theme choice on a news siteUsually yesA cookie in your browser
Your password, saved by the browserNoThe browser's password manager
Your shopping basket while signed outOften yesA cookie, sometimes local storage too
Your browsing historyNoThe browser's own history list
A site's record of your ordersNoThe site's servers, tied to your account

Frequently Asked Questions

Do all websites use cookies?

Most interactive sites do, anything with sign-in, preferences or a basket needs them or something like them. A simple static page may set none, which is why Cookie Editor sometimes shows an empty list.

Can a cookie contain a virus?

No. Cookies are plain text data. The risk with cookies is privacy and session theft (someone stealing a session value), not infection.