
A cookie is a small piece of data that a website stores in your browser and gets back with your later requests. Cookies differ in how long they live, who sets them and how they are protected. For privacy, one difference matters most: a first-party cookie comes from the site you are on, a third-party cookie comes from someone else and can be used to follow you from site to site.
What are cookies?
When you open a site, its server can send your browser a cookie: a name and a value, often just an ID. The browser stores it and sends it back with every later request to that site. The MDN guide to cookies names three main uses: keeping a session (you stay signed in, your cart stays full), remembering preferences such as language, and tracking behavior.
Why do websites ask you about cookies?
In the European Union, the ePrivacy Directive and the GDPR require a website to ask for your consent before it uses certain cookies. The EU’s own guidance for businesses draws the line like this:
- No consent is needed for strictly necessary cookies, for example the one that keeps items in your shopping basket or keeps you signed in.
- Consent is needed for tracking cookies, such as third-party cookies used for behavioral advertising.
- Withdrawing consent must be as easy as giving it, and a visitor who withdraws it must still get at least a minimum service.
So the banner is a real choice. A site that follows these rules cannot lock you out completely because you refused its tracking cookies.
The 7 types of cookies
The types overlap, because they describe different properties. The first two are about lifetime, the next two about who sets the cookie, the two after that about protection, and the last is a form of abuse.
1. Session cookies
A session cookie has no expiry date. The browser deletes it when the browsing session ends. It carries you from one page to the next: without it, the basket of a shop you use as a guest would be empty after every click. Browsers that restore your tabs at startup can keep session cookies alive across restarts.
2. Persistent cookies
A persistent cookie, also called a permanent cookie, has an expiry date or a maximum age set by the site. It stays in the browser until then, or until you delete it. This is the cookie behind “keep me signed in” and saved preferences. The same mechanism lets a site recognize a returning visitor, which is why persistent cookies are also used for tracking. Safari shortens their life in one case: cookies created by a script are deleted after seven days in which you did not interact with the site.
3. First-party cookies
A first-party cookie is created by the site whose address is in the address bar. Sign-in, baskets and preferences work with first-party cookies. A first-party cookie tells the site about your visits to that site only.
4. Third-party cookies
A third-party cookie is created by another site whose content is built into the page: an ad, a share button, a video player. Because the same company’s content sits on many sites, its cookie can link your visits to all of them into one profile. Used like that, third-party cookies are called tracking cookies. They have harmless uses too, such as keeping you signed in across several sites of one company.
Browsers have been closing this door, each in its own way:
| Browser | Third-party cookies by default |
|---|---|
| Safari | Blocked. |
| Firefox | Kept in a separate “cookie jar” for every site (Total Cookie Protection), so they cannot follow you across sites. Cookies of known trackers are blocked. |
| Chrome | Allowed in normal windows, blocked in Incognito. In April 2025 Google announced that Chrome will keep this approach and leave the choice to you in the settings. |
| Edge | Allowed unless you block them. Tracking prevention blocks trackers from sites you have not visited. |
5. Secure cookies
A cookie with the Secure attribute is sent only over an encrypted HTTPS connection, which protects it from being read on the network. The name promises more than that: the cookie is still stored in your browser, where someone with access to the computer could read or change it. This is why sites are advised to keep only an identifier in a cookie and the sensitive data on the server.
6. HttpOnly cookies
A cookie with the HttpOnly attribute cannot be read by scripts running in the page. Only the server gets it. This limits the damage of a cross-site scripting (XSS) attack, in which an attacker gets a script into a trusted site and tries to steal the session cookie. A cookie can be Secure and HttpOnly at the same time, and MDN recommends HttpOnly for the cookies that keep you signed in. A third attribute, SameSite, lets a site say whether its cookie may be sent with requests that come from other sites.
7. Zombie cookies
A zombie cookie is one that comes back after you delete it, because the site has hidden a copy of the identifier somewhere else and recreates the cookie from it. MDN describes these techniques as a violation of user privacy and control that may break data protection law. Older lists also name Flash cookies as a type of their own. They needed the Adobe Flash plug-in, which Adobe and the browser makers retired at the end of 2020.
Can cookies be blocked?
Yes. Blocking third-party cookies stops the cross-site kind of tracking while sign-ins and baskets keep working. Some embedded features, such as social media widgets, may stop working.
- Chrome: Settings → Privacy and security → Third-party cookies → Block third-party cookies.
- Edge: Settings → Privacy, search, and services → Cookies → Block third-party cookies.
- Firefox: the default setting already isolates them. To block them all, choose Settings → Privacy and security → Enhanced Tracking Protection → Custom, check Cookies and select All cross-site cookies. Firefox warns that this may break websites.
- Safari: keep Safari → Settings → Privacy → Prevent cross-site tracking selected.
Blocking all cookies is possible too (in Safari, Settings → Advanced → Block all cookies), but then most sites cannot keep you signed in. A private window is the milder option: it accepts cookies and deletes them when you close it.
How to manage cookies
Every browser shows which sites have stored data and lets you delete it, for one site or for all of them.
- Chrome: Settings → Privacy and security → Third-party cookies → See all site data and permissions.
- Edge: Settings → Privacy, search, and services → Cookies → See all cookies and site data.
- Firefox: Settings → Privacy and security → Browsing data → Clear data for specific sites.
- Safari: Safari → Settings → Privacy → Manage Website Data. More in how to disable and enable cookies in Safari.
Deleting cookies signs you out of the sites concerned. Kingpin, our private browser for Mac, blocks third-party cookies and keeps the remaining cookies in memory only, so by default none are left after you quit.