# First-party vs third-party cookies: the difference, and what browsers block now

The CrispStats team · Published 2026-11-23 · Updated 2026-11-29

**TL;DR:** A first-party cookie belongs to the site in your address bar; a third-party cookie belongs to a different domain, usually an ad, social or embed script on that page, and is what lets one company recognise you across many sites. Safari blocks all third-party cookies by default, Firefox gives every site its own separate cookie jar, Edge blocks storage for known trackers, and Chrome still allows them unless you change the setting. First-party cookies are not blocked, but Safari limits those set by JavaScript to 7 days without interaction, which shortens analytics cookies such as Google Analytics' two-year default.

The difference between first-party and third-party cookies is not the cookie itself. Both are small text values the browser stores and sends back. What differs is whose domain the cookie belongs to compared with the site you are looking at, and that one fact decides what the cookie can be used for, including [cross-site tracking](/blog/what-is-cross-site-tracking), and how browsers treat it.

## What is the difference between first-party and third-party cookies?

MDN's [definition](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Third-party_cookies) is the clearest: a cookie is first-party when its domain and scheme match the page shown in the address bar, and third-party (also called cross-site) when they do not.

|  | First-party cookie | Third-party cookie |
| --- | --- | --- |
| Belongs to | The site in the address bar | Another domain loaded by the page |
| Set by | The site's server, or a script running on the site | An image, iframe or script from the other domain |
| Sent back | Only to that site | To the other domain, from every site that loads it |
| Typical uses | Login sessions, baskets, language, consent choice, analytics ids | Ad targeting and retargeting, social widgets, some embeds |
| Can follow you across sites | No, not on its own | Yes, that is its main use |
| Browser defaults in 2026 | Allowed everywhere, with lifetime caps in Safari | Blocked or partitioned in Safari, Firefox, Brave; allowed in Chrome |

One detail trips people up: a third-party script can set a first-party cookie. Google Analytics is the common example. The `gtag.js` script comes from Google, but it writes the `_ga` cookie on your own domain, so the cookie is first-party. That is why it survives third-party cookie blocking, and also why Safari's limits on script-set cookies affect it.

### See it in your own browser

Open developer tools on any page, go to Application (Storage in Firefox), then Cookies. Each cookie lists its domain. Here is what a news page might set:

```text
Domain              Name        Expires      Party
news.example        session_id  Session      first
.news.example       _ga         2 years      first (set by Google's script)
cdn.ads.example     uid         13 months    third
video.example       vis         6 months     third
```

## What do browsers block now?

Each row is taken from the browser vendor's own documentation, read on 23 November 2026.

| Browser | Third-party cookies | First-party cookies | Source |
| --- | --- | --- | --- |
| Safari (WebKit) | All blocked by default, no exceptions | Cookies set by JavaScript, and other script-writable storage, deleted after 7 days without interaction; 24 hours when you arrive through a decorated link | [WebKit tracking prevention](https://webkit.org/tracking-prevention/) |
| Firefox | Partitioned: a separate cookie jar for each site you visit (Total Cookie Protection, default for all desktop users) | Allowed | [Mozilla](https://blog.mozilla.org/en/products/firefox/firefox-rolls-out-total-cookie-protection-by-default-to-all-users-worldwide/), [MDN](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Third-party_cookies) |
| Chrome | Allowed in normal windows unless you block them; blocked in Incognito | Allowed | [Chrome Help](https://support.google.com/chrome/answer/95647), [MDN](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Third-party_cookies) |
| Edge | Storage blocked for trackers in the advertising, content, social and other categories on the default Balanced level; analytics trackers only on Strict | Allowed | [Microsoft Edge docs](https://learn.microsoft.com/en-us/microsoft-edge/web-platform/tracking-prevention) |
| Brave | Tracking cookies blocked | Allowed | [MDN](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Third-party_cookies) |

### Why did Chrome not phase out third-party cookies?

Google planned for years to remove them and build replacement APIs under the name Privacy Sandbox. It changed course in the summer of 2024, and in an [April 2025 update](https://privacysandbox.google.com/blog/privacy-sandbox-next-steps) said it would keep the current approach of letting users choose in Chrome's settings and would not roll out a standalone prompt. In [October 2025](https://privacysandbox.google.com/blog/update-on-plans-for-privacy-sandbox-technologies) Google retired most of the replacement technologies, among them Topics, Protected Audience, Attribution Reporting and Related Website Sets, while keeping CHIPS (partitioned cookies) and FedCM. The net result: in Chrome, third-party cookies work as they always did unless a person blocks them.

## What does this mean for analytics?

Analytics tools that rely on cookies almost all use first-party cookies, so third-party blocking barely touches them. The lifetime caps do.

Google says the `_ga` cookie [lasts two years by default](https://support.google.com/analytics/answer/11397207). In Safari, because it is set by JavaScript, WebKit deletes it after 7 days without interaction with your site. A visitor who comes back after 10 days gets a new id and is counted as a new user.

### Worked example: returning visitors in Safari

Say 1,000 Safari visitors read your blog this month and 300 of them come back 10 to 30 days later. In Chrome, where the cookie lives its full two years, all 300 would be recognised as returning. In Safari, each of the 300 has had their `_ga` cookie deleted after 7 days, so the tool reports 1,300 users instead of 1,000, and a returning-visitor rate of roughly 0% for that group instead of 30%. The numbers are an example, not a measurement; the direction is what matters. Returning-visitor and retention reports skew by browser mix.

> **Why server-side setups are popular.** A cookie set by your own server in an HTTP response is not created in JavaScript, so WebKit's 7-day cap on JavaScript cookies does not apply to it, which is one reason vendors promote [server-side tagging](/blog/cookieless-tracking-explained). WebKit does cap cookies set through third-party CNAME or IP cloaking at 7 days.

## Do first-party cookies need consent?

In the EU and UK, the party a cookie belongs to does not decide consent. The purpose does. The [ePrivacy rule](/glossary/eprivacy-directive) (PECR in the UK) requires [consent](/glossary/cookie-consent) to store or read information on a device unless it is strictly necessary for a service the person asked for, or falls under a specific exemption. A first-party login cookie is strictly necessary; a first-party advertising cookie is not.

First-party analytics cookies sit in between, and regulators differ. France's CNIL [describes conditions](https://www.cnil.fr/fr/cookies-et-autres-traceurs/regles/cookies-solutions-pour-les-outils-de-mesure-daudience) under which audience measurement trackers are exempt, including that the data serves only the site's own statistics and is not combined or shared, and it recommends a cookie lifetime of about 13 months. The UK ICO describes a [statistical purposes exception](https://ico.org.uk/for-organisations/direct-marketing-and-privacy-and-electronic-communications/guidance-on-the-use-of-storage-and-access-technologies/what-are-the-exceptions/) with similar limits and a simple way to object. Other regulators require consent for analytics cookies. Our guide to [analytics and consent in Europe](/blog/analytics-and-consent-in-europe) sets out the published positions country by country, and your own counsel decides for your site.

Third-party cookies used for advertising need consent across the EU and UK. There is no exemption for them.

## What replaces third-party cookies?

- **Partitioned cookies (CHIPS).** A third-party cookie with the `Partitioned` attribute gets a separate jar per top-level site. It works for embeds such as a chat widget but cannot follow anyone across sites.
- **The Storage Access API.** An embed asks the user for permission to use its cookies inside a specific site, used for logins inside iframes.
- **First-party data.** Sign-ups, logins and purchases you collect directly, with the consent your law requires. See [first-party data](/glossary/first-party-data).
- **Server-side tracking.** Events sent from your server rather than the browser; see [server-side tracking](/glossary/server-side-tracking).
- **Cookieless measurement.** Counting visits without storing anything on the device, covered in [cookieless tracking explained](/blog/cookieless-tracking-explained).

Before changing anything, audit what your own site sets:

1. List every cookie your site sets in a private window, before and after accepting your banner.
2. Mark each as first-party or third-party, and note its purpose and lifetime.
3. Remove what you do not use, and load the rest only after consent where the purpose requires it.
4. Expect cookie-based returning-visitor numbers to differ by browser, and read them with that in mind.

## How CrispStats fits

CrispStats sets no cookies at all, first-party or third-party, and by default writes nothing to the visitor's device. It counts visitors with a daily rotating [visitor hash](/glossary/visitor-hash) computed on the server and discards the IP address and user agent afterwards. Because nothing is stored in the browser, Safari's 7-day cap and third-party blocking do not change its numbers: a visitor is counted the same way in every browser.

The trade-off is stated plainly in our [cookie policy](/legal/cookies): returning visitors are recognised within a day, not across days, unless you switch on the opt-in persistent visitors mode, which stores a random id in localStorage and should only run with consent. Some ad blockers block analytics scripts by hostname, which the [proxy setup](/docs/tracking/proxy) addresses by serving the script from your own domain.

## Does blocking third-party cookies remove the banner?

No. Blocking third-party cookies is a browser setting. A banner is a consent step for storage on the device, and first-party cookies are still storage. A first-party analytics cookie, such as the one set on your own domain, is not stopped by Safari or Firefox blocking third-party cookies. Other scripts on the page can set their own first-party cookies at the same time.

The banner is about the page, not about one cookie's party. If analytics sets a first-party cookie, that cookie is one reason. Advertising, video and chat can be others, even when every third-party cookie is blocked. The split is in [do you need a cookie banner for analytics](/blog/do-you-need-a-cookie-banner-for-analytics). In the EU and UK the purpose decides consent, which the section above already covers. This is general information, not legal advice.

## Is a first-party analytics cookie cookieless or anonymous?

Neither. It is a cookie, so the setup is not cookieless. And a first-party cookie can still hold an identifier that follows a browser on that site for as long as the cookie lasts. The European Commission lists a cookie id as personal data. The ICO says cookie identifiers may be personal data, and the CCPA lists cookies. NIST does not name cookie ids. [PII examples](/blog/pii-examples-in-analytics) keeps those distinctions. First-party means the cookie belongs to the site in the address bar. It does not mean the data cannot be tied to a browser.

Cookieless analytics stores nothing on the device and counts with a short-lived hash. That design is in [cookieless analytics explained](/blog/cookieless-analytics-explained). It is not the same as a two-year first-party cookie, and it is not a finding that the data is anonymous in every law. Cookieless advertising, which tries to recognise people for ads without a third-party cookie, is a different job and is not covered here. [Cookieless analytics](/analytics/cookieless-analytics) is the site-measurement page.

## Frequently asked questions

### Are first-party cookies safe?

They cannot follow you across different websites on their own, which makes them less intrusive than third-party cookies. They can still hold an id that tracks you on one site for years, and a site can pass that id to other companies. Safe depends on what the site does with it.

### Does Chrome block third-party cookies in 2026?

Not by default. Chrome allows third-party cookies in normal windows and blocks them in Incognito. Google confirmed in April 2025 that it would keep this user choice in settings rather than phase them out, and in October 2025 it retired most of the Privacy Sandbox APIs designed to replace them.

### Is the Google Analytics cookie first-party or third-party?

First-party. Google's script sets the _ga cookie on your own domain, with a default lifetime of two years. Because JavaScript sets it, Safari deletes it after 7 days without interaction with your site.

### Should I accept or reject third-party cookies?

Rejecting them limits how ad companies follow you between sites and rarely breaks anything apart from some embedded logins and widgets. Most browsers other than Chrome already block or partition them for you.

### Do first-party cookies need a cookie banner?

In the EU and UK it depends on the purpose, not on who owns the cookie. Strictly necessary cookies such as a login or basket need no consent. Analytics cookies need consent in some countries and can be exempt under conditions in others, such as France and the UK. Advertising cookies need consent.

### If browsers block third-party cookies, do I still need a banner for analytics?

In the EU and UK, often yes if the analytics tool sets a first-party cookie or other storage. Blocking third-party cookies does not exempt first-party storage. Some regulators describe narrow exemptions for audience measurement. Your own counsel decides. This is general information, not legal advice.

### Does a first-party cookie make analytics anonymous?

No. First-party means the cookie belongs to the site in the address bar. It can still hold an identifier that follows a browser on that site for months or years. Anonymous data cannot be traced back to a person. A long-lived cookie id is not that.
