Tracking, Ads and Data Brokers

What Browser Cookies Are and What They Do

What browser cookies are, how first-party and third-party cookies differ, what each can and cannot reveal, and how to manage them sensibly.

On this page
  1. A small note the browser keeps
  2. What cookies are used for
  3. First-party cookies
  4. Third-party cookies
  5. What cookies can and cannot reveal
  6. Beyond ordinary cookies
  7. Managing cookies

A small note the browser keeps

A cookie is a small piece of text that a website asks your browser to store. The next time your browser contacts that site, it sends the text back. That is the whole mechanism. A cookie is not a program, does not run code and cannot read your files. It is closer to a coat-check ticket: it carries no information about you by itself, but it lets the site recognise the browser that holds it.

The web needs this because the basic protocol is “stateless”: each request is treated as new, with no memory of earlier ones. Cookies give sites a way to string requests together into something that feels continuous.

What cookies are used for

  • Staying signed in. After you log in, the site stores a session identifier so that you do not have to enter your password on every page.
  • Remembering a basket or preferences. Items in a cart, a chosen language, dark mode or a region.
  • Security. Some cookies help a site detect suspicious activity or protect against forged requests.
  • Measuring. Analytics cookies count visitors and show which pages they use.
  • Advertising. Cookies can recognise a browser for ad selection, limiting how often you see an ad and measuring whether it led to a purchase.

Many of these are harmless or helpful. The privacy debate concerns mainly the last category and the way cookies can be shared across sites.

First-party cookies

A first-party cookie is set by the site you are actually visiting. If you visit a shop and its address appears in the bar, a cookie from that shop is first-party.

These are what make logins and baskets work. By themselves they let a single site recognise you on its own pages. They can still be used to track you within that site, and the site may combine what it learns with other information it holds, such as your account details. But a first-party cookie from one site is not readable by an unrelated site.

Third-party cookies

A third-party cookie comes from a different domain than the one in the address bar. A page often loads content from other companies, such as ad servers, analytics firms or social media buttons. Those requests can set cookies belonging to the other company.

The significance emerges when the same company is present on many sites. Its cookie is the same wherever you go, so it can note that one browser visited a recipe site, a travel page and a news article. That cross-site record is the foundation of much online tracking and of interest-based advertising.

Third-party cookies are not always sinister. A video player or embedded payment form may rely on one for a legitimate reason. Because of tracking concerns, several major browsers now block them by default or restrict them, while others leave the decision to users. Policies have shifted over the years and differ from browser to browser, so check the settings of the one you use.

What cookies can and cannot reveal

A cookie normally contains an identifier, not a biography. The information lives on the server of whoever set it, linked to that identifier.

A cookie cannot:

  • see your passwords or other files
  • tell a site what you do on pages where that company has no presence
  • carry a virus by itself

A cookie can enable a company to:

  • link your visits to its own pages or those hosting its code
  • connect activity to an account when you sign in, at which point your name or email may become associated with the history
  • infer interests from the kinds of pages you visit

Cookies are also tied to one browser on one device. A different browser, or a phone, would have its own, unless the company links them by login or other identifiers.

Beyond ordinary cookies

Blocking cookies does not end tracking. Sites and trackers can use other browser storage, identifiers placed in web addresses, signed-in accounts, or device traits through browser fingerprinting. Cookies are only the most visible technique.

Managing cookies

  • Clear them occasionally. This logs you out and resets preferences, and it removes identifiers from trackers. It is a limited fix, as new cookies appear when you browse again.
  • Block third-party cookies. Often a good balance, though a few embedded features may stop working.
  • Block all cookies. Strong, but many sites will fail, including logins.
  • Use separate profiles or a private browser. Private windows typically discard cookies when closed, though they do not hide your activity from the sites or your network.
  • Respond to consent banners deliberately. In regions with data protection laws on tracking, sites often ask first. Rejecting optional categories is usually possible, though the layout can make it less obvious.
  • Add tracker blockers with care. Some browser extensions help, but each has access to your browsing and should come from a source you trust.

Consider keeping cookies for sites you use often and trust, and clearing the rest. That way you keep the convenience and limit the broader record that third-party cookies would otherwise build.

The complete guide to tracking, ads and data brokers

How Online Tracking Works Across Websites and Apps
Read the guide

Keep exploring

Guides from other topics

All topics →