← Back to blog

CHIPS Is for Embed State, Not Cross-Site Identity

CHIPS gives an embedded component a separate cookie jar for each top-level site. Learn when that is useful—and why it cannot provide shared third-party identity.

A partitioned cookie can keep an embedded widget signed in on one site; it cannot give that widget a shared identity across every site that embeds it. That distinction changes how developers should design chat, payment, document, and account-provider embeds.

CHIPS Gives Each Embedder Its Own Session

CHIPS (Cookies Having Independent Partitioned State) lets a cross-site embed opt a cookie into partitioned storage with the Partitioned attribute. The browser keys that cookie by the cookie-setting site and the top-level site. When the same vendor is embedded on two unrelated sites, it gets two separate cookie jars—not one vendor-wide jar.

For example, support.example embedded on shop.example can set a session cookie scoped to that embedding context:

Set-Cookie: __Host-widget_session=opaque-value; Secure; Path=/; SameSite=None; Partitioned

These guarantees depend on browser support. An unsupported Partitioned attribute may be ignored, leaving an unpartitioned third-party cookie if the browser permits one. Test each target browser and do not assume the attribute alone enforces isolation.

The browser sends that cookie when the widget is loaded under shop.example, but not when the same widget is loaded under docs.example. The partitioned cookie also does not become a universal cookie when a user visits support.example directly. Each top-level site is a separate context, so a first visit to another embedder starts without the earlier site's widget session.

This is useful when the embedded component needs state local to one publisher: a support conversation attached to that site, a per-site preference, or a cart belonging to a single storefront. The embed can keep state without treating its presence on unrelated sites as a shared identifier.

Match the Cookie to the State You Need

Choose CHIPS when the feature still works if each embedding site has an independent session. Your server must be prepared for a missing cookie on a new top-level site and should create a new embed-scoped session rather than infer that the user is globally signed out—or silently try to join that session to another site's state.

Do not use a partitioned cookie as the account cookie for a service that expects a person to be recognized across unrelated publishers. The browser is enforcing the opposite behavior: the same third-party origin receives different partitioned state in different top-level contexts. A widget that needs a common account must obtain identity through a separate, explicit flow.

That separation is an architectural choice, not a bug to work around by renaming cookies or rotating values. If an embed's core function depends on the same identity being available everywhere, CHIPS alone does not meet the requirement. If only the embed's local state needs continuity, partitioning is a better fit than relying on a site-wide third-party cookie.

Storage Access Is a Different Contract

When an embed genuinely needs its unpartitioned, first-party state—for example, to show an account the user already signed into at the provider's own site—the Storage Access API (SAA) offers a separate request path. The embedded document can check document.hasStorageAccess() and, when needed, call document.requestStorageAccess(). A grant concerns access from that embedded context; it does not convert CHIPS cookies into a shared cookie jar.

Treat the request as a conditional branch in the product flow. Browsers can require user activation, a prior first-party visit, or other eligibility conditions, and the request can be denied. WebKit's implementation guidance, for example, places the request behind a user action and requires prior first-party interaction. Browser policies differ, so a successful result in one engine is not proof that every user's embed will receive access.

loginButton.addEventListener("click", async () => {
  try {
    await document.requestStorageAccess();
    await loadAccount();
  } catch {
    showSignedOutExperience();
  }
});

The fallback is part of the feature, not an exceptional error screen. Let the user continue with the embed's public or local-state features when access is unavailable, and offer a clear sign-in action when account-specific data is needed. Also remember that access to the embedded document's storage does not automatically attach that identity to requests sent to a different API origin.

Test the Boundary, Not Just the Happy Path

Test the same embed under two different top-level sites and confirm that each begins with independent state. Then test the provider as a top-level site, a denied SAA request, and the cross-origin API calls the embed makes. Inspect the partition key in browser developer tools and verify what cookies actually reach each endpoint.

These cases expose the assumption that often breaks embedded applications: a third-party component can be present in many places without being the same logged-in user in all of them. Use CHIPS for state that belongs to one embedding site; use an explicit, user-mediated identity flow when the product truly needs a shared account.

Sources

Comments

Loading comments…