Third-party cookie

A third-party cookie is a cookie from a site that is not the site in the address bar. A cookie of a cross-site iframe is a third-party cookie.

Concept

Also called Cross-site cookie

Updated

On this page

How it works

The browser compares the domain and scheme of the cookie with the page in the address bar. If they match, the cookie is a first-party cookie. If they do not match, it is a third-party cookie. A cookie from a subdomain of the top page is still first-party.

A third-party cookie needs SameSite=None and Secure to go with requests from a cross-site frame. Even then, the browser can block it. Ad networks use third-party cookies to follow people across sites, so browsers limit them.

Browser rules

BrowserThird-party cookies by default
SafariBlocked by Intelligent Tracking Prevention
FirefoxA separate cookie jar for each top-level site (Total Cookie Protection)
ChromeAllowed. Blocked in Incognito and when the user turns on blocking

In April 2025, Google said Chrome keeps the current user choice for third-party cookies. Google did not add a new prompt for them.

For an iframe that needs state, use a Partitioned cookie (CHIPS) or the Storage Access API. A partitioned cookie keeps one copy for each top-level site. The Storage Access API asks for the normal, unpartitioned cookies.

Example

HTTP response header from https://widget.example
Set-Cookie: widget_session=7yjgj57e4n3d; SameSite=None; Secure; HttpOnly

On https://shop.example, this cookie from the widget frame is a third-party cookie.

How to set it

Send SameSite=None and Secure, or the browser does not send the cookie in a cross-site frame. Add Partitioned for browsers that block third-party cookies.

# Sent in a cross-site frame, if the browser allows third-party cookies
Set-Cookie: session=abc123; Path=/; Secure; HttpOnly; SameSite=None

# One copy for each top-level site (CHIPS)
Set-Cookie: __Host-session=abc123; Path=/; Secure; HttpOnly; SameSite=None; Partitioned

Test in Safari and in a Chrome Incognito window. Both block third-party cookies by default.

Learn more

Sources

Know before you embed.

Free, no sign-up, nothing stored. Paste a URL and get a verdict, a live preview, and the fix.