What a cookie is
A cookie is a small piece of text that a website asks your browser to store. When you return, the browser sends it back, so the site can recognize it. Cookies were created to solve a basic problem: the web does not remember anything by itself. Without them, a shopping cart would empty when you changed pages, and you would have to log in again on every click.
A cookie typically holds an identifier, not your name or a detailed profile. The site’s own records link that identifier to whatever it knows about the visit.
First-party cookies
First-party cookies are set by the site you are actually visiting. They commonly handle:
- keeping you logged in
- remembering items in a cart
- saving language or display preferences
- counting visits for the site’s own statistics
Most are harmless and useful. A site that analyzes its own visits with them is doing basic web analytics, which is generally less intrusive than tracking you across the wider web, although it still involves collecting data about you.
Third-party cookies
Third-party cookies are set by a different domain than the one in your address bar. This happens because a page loads content or code from other companies: advertising networks, social media buttons, embedded videos, measurement tools. Each of those requests lets the other company set or read its own cookie.
If the same outside company is embedded on many sites, its cookie is the same on all of them. That lets it notice that one browser visited a news site, then a recipe site, then an online shop. Over time, it can build a profile of interests, such as “often reads about travel,” without ever knowing your name.
How tracking follows you
The usual sequence looks like this:
- You visit a page that includes an advertising or tracking script.
- The script reads or sets a cookie containing a random identifier.
- Each time you meet the same tracker on another site, it records the visit against that identifier.
- The accumulated profile helps decide which ads to show, and may be shared or sold to others.
This is the mechanism behind retargeting: you look at a product, leave, and later see ads for it elsewhere. It is also a basic building block of much of today’s digital marketing.
Tracking without cookies
Blocking cookies helps, but trackers have other methods:
- Browser fingerprinting. A site combines many small details, such as screen size, fonts, language and browser version, into a profile that may be distinctive enough to recognize your device. It is less reliable than a cookie but harder to clear.
- Tracking pixels. A tiny invisible image loaded from a tracker’s server tells it that a page, or an email, was opened. Email marketing tools commonly use these to measure opens.
- Logins. If you are signed in to an account, the company can connect activity on its own and partner services to you directly.
- Device and app identifiers. Phones can provide advertising identifiers to apps, a separate system from browser cookies. Resetting or limiting these is possible in the phone’s settings.
- Link decoration. Identifiers can be added to the end of a web address as you click from one site to another.
Why it exists and what it costs
Tracking supports targeted advertising, which funds many free sites, and it helps businesses understand which content or campaigns work. For you, the downsides include detailed profiles held by companies you have never heard of, the chance that profiles are leaked or sold, and ads or prices that are tailored in ways you cannot see. How much that bothers you is a personal judgment.
What you can do
- Block third-party cookies in your browser settings. This is the biggest single step, and the choices are walked through in the article on browser privacy settings.
- Respond carefully to cookie banners. Where a site offers “reject non-essential” or a settings panel, choosing it limits tracking by that site. Consent rules in some regions are why those banners exist.
- Clear cookies now and then, or set the browser to do so on exit, accepting that you will need to log in again.
- Limit ad personalization in your account and phone settings. This usually changes what ads you see rather than whether data is collected.
- Use tracker-blocking tools or extensions from sources you trust, knowing they can occasionally break pages.
- Be selective about logins. Using “sign in with” another service links more of your activity to a single identity.
Setting expectations
You cannot completely avoid tracking and still use most of the web, and no single setting removes it. The realistic aim is to reduce how easily one company can follow you from site to site, and to make a deliberate choice about the trade-offs. Cookies themselves are not malware; the concern is how the data is used and who ends up holding it.