Privacy
First-party vs third-party cookies: the difference, and what browsers block now
First-party cookies belong to the site you visit, third-party cookies to another domain. What Safari, Firefox, Chrome and Edge block now, from their own docs.
The CrispStats team · · 7 min read
In short
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, and how browsers treat it.
What is the difference between first-party and third-party cookies?
MDN’s definition 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.
| Row | 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:
Domain Name Expires Partynews.example session_id Session first.news.example _ga 2 years first (set by Google's script)cdn.ads.example uid 13 months thirdvideo.example vis 6 months thirdWhat 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 |
| Firefox | Partitioned: a separate cookie jar for each site you visit (Total Cookie Protection, default for all desktop users) | Allowed | Mozilla, MDN |
| Chrome | Allowed in normal windows unless you block them; blocked in Incognito | Allowed | Chrome Help, MDN |
| 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 |
| Brave | Tracking cookies blocked | Allowed | MDN |
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 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 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. 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.
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 (PECR in the UK) requires 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 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 with similar limits and a simple way to object. Other regulators require consent for analytics cookies. Our guide to 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
Partitionedattribute 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.
- Server-side tracking. Events sent from your server rather than the browser; see server-side tracking.
- Cookieless measurement. Counting visits without storing anything on the device, covered in cookieless tracking explained.
Before changing anything, audit what your own site sets:
- List every cookie your site sets in a private window, before and after accepting your banner.
- Mark each as first-party or third-party, and note its purpose and lifetime.
- Remove what you do not use, and load the rest only after consent where the purpose requires it.
- 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 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: 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 addresses by serving the script from your own domain.