Set-Cookie blocked: SameSite=Lax cookie in a cross-site frame

The page in the frame tries to set a cookie with SameSite=Lax or SameSite=Strict. In a frame from another site, the browser does not keep that cookie, so a login or a cart in the frame does not work.

  • Chrome
  • Edge
  • Firefox

Updated

DevTools message · Chrome and Edge, exact text

This attempt to set a cookie via a "Set-Cookie" header was blocked because it had the "SameSite=Lax" attribute but came from a cross-site response which wasn’t the response to a top-level navigation

Chrome, EdgeExact text

The frame loads, but the cookie is not set. DevTools shows the note in the Network panel, on the Cookies tab of the request.

This attempt to set a cookie via a "Set-Cookie" header was blocked because it had the "SameSite=Lax" attribute but came from a cross-site response which wasn’t the response to a top-level navigation

FirefoxExact text

The frame loads, but the cookie is not set.

Cookie “session” has been rejected because it is in a cross-site context and its “SameSite” is “Lax” or “Strict”.

On this page

What it means

The page in the frame asked the browser to keep a cookie. The cookie says it is only for same-site use, and the frame is on another site, so the browser does not keep it. The next request from the frame has no cookie. Read about cookies in iframes.

Why it happens

The page in the frame sends a cookie like this one:

Set-Cookie: session=abc123; SameSite=Lax
  1. SameSite=Lax and SameSite=Strict cookies are for first-party use. A frame from another site is not first-party.

  2. A cookie with no SameSite attribute counts as Lax in Chrome and Edge.

  3. When the browser sends the cookie back, DevTools shows a second note: the cookie “was blocked because it had the "SameSite=Lax" attribute and the request was made from a different site”.

Check the page

See the headers the page sends now

Fix it if you own the site

Set the cookie with SameSite=None; Secure. Add Partitioned so the browser keeps a separate copy of the cookie for each top site (CHIPS). The cookies guide has the details.

Response header
Set-Cookie: session=abc123; Path=/; Secure; HttpOnly; SameSite=None; Partitioned

A cookie with SameSite=None must also have Secure, and the page must use HTTPS. Without Secure, the browser rejects the cookie.

If you do not own the site

You cannot change the cookies of another site. Use one of these.

  1. Open the page in a new tab

    Link to the page so the user signs in on the site itself, where its cookies work.

  2. Use the official embed

    Some services give an embed that needs no login, or one that is made for frames.

  3. Ask the owner

    Ask them to set their cookie with SameSite=None, Secure and Partitioned.

Sources

Know before you embed.

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