Skip to content

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.

What is the difference between first-party and third-party cookies?
RowFirst-party cookieThird-party cookie
Belongs toThe site in the address barAnother domain loaded by the page
Set byThe site’s server, or a script running on the siteAn image, iframe or script from the other domain
Sent backOnly to that siteTo the other domain, from every site that loads it
Typical usesLogin sessions, baskets, language, consent choice, analytics idsAd targeting and retargeting, social widgets, some embeds
Can follow you across sitesNo, not on its ownYes, that is its main use
Browser defaults in 2026Allowed everywhere, with lifetime caps in SafariBlocked 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     third

What do browsers block now?

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

What do browsers block now?
BrowserThird-party cookiesFirst-party cookiesSource
Safari (WebKit)All blocked by default, no exceptionsCookies set by JavaScript, and other script-writable storage, deleted after 7 days without interaction; 24 hours when you arrive through a decorated linkWebKit tracking prevention
FirefoxPartitioned: a separate cookie jar for each site you visit (Total Cookie Protection, default for all desktop users)AllowedMozilla, MDN
ChromeAllowed in normal windows unless you block them; blocked in IncognitoAllowedChrome Help, MDN
EdgeStorage blocked for trackers in the advertising, content, social and other categories on the default Balanced level; analytics trackers only on StrictAllowedMicrosoft Edge docs
BraveTracking cookies blockedAllowedMDN

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.

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 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.
  • 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:

  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 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.

Guide questions. Straight answers.

What people ask after reading this.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

Not answered here? Write to hello@crispstats.com

Go further

Free tools

  • Churn rate calculator

    Calculate customer churn or gross and net revenue churn for a month, quarter or year, with monthly and yearly equivalents and the average customer lifetime.

Use cases

  • CrispStats for SaaS

    See which channels bring paying customers, where trials stall in the funnel, and how your app performs for real users, from one cookieless script.

Your traffic, crisp and clear

One script, no cookies, and every feature from the first day. Set up takes about as long as pasting a snippet.