SameSite cookie blocked Authentication Origin: Application & API Last updated 12 Oct 2026

This Set-Cookie was blocked because it had the "SameSite=Lax" attribute but came from a cross-site response / SameSite=None requires Secure

The browser refused to store or send an auth/session cookie because of SameSite or Secure rules — so logins don’t “stick” across sites or iframes.

Exact message you may see This Set-Cookie was blocked because it had the "SameSite=Lax" attribute but came from a cross-site responseSameSite=None requires Securecookie was rejected because it is in a cross-site contextThis attempt to set a cookie via a Set-Cookie header was blocked
Seen on: REST API

Meaning

Cross-site requests (frontend on app.com, API on api.otherdomain.com, embedded iframes, OAuth POST callbacks) need SameSite=None; Secure cookies over HTTPS. Browsers also increasingly block third-party cookies entirely.

Common causes

  • API on a different site than the frontend with default SameSite=Lax
  • SameSite=None without Secure (or on http)
  • App embedded in an iframe on another site
  • Third-party cookie blocking (Safari, Chrome)

⚡ Quick fix

  1. Serve frontend and API on the same site (subdomains of one domain)
  2. Use SameSite=None; Secure over HTTPS when cross-site is required
  3. Prefer token-based auth for cross-site APIs

Detailed fix by platform

JavaScript

  1. res.cookie("sid", value, { httpOnly: true, secure: true, sameSite: "none", domain: ".example.com" });

How to diagnose

  1. Sites — Frontend vs API registrable domain
  2. Flags — SameSite/Secure in Set-Cookie
  3. DevTools — Cookie warnings in Network/Application

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

431 — HTTP 431 Request Header Fields Too Large (HTTP)431blocked a frame — SecurityError: Blocked a frame with origin "x" from accessing a cross-origin frame. (JavaScript)blocked a frameCookies are blocked — WordPress login: Error: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. (WordPress)Cookies are blockedCORS — CORS Error: No 'Access-Control-Allow-Origin' header is present (API)CORScross-origin error — Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development. (React)cross-origin errorCSP violation — Refused to load the script because it violates the following Content Security Policy directive (JavaScript)CSP violationExpiredToken — AWS: ExpiredToken — The security token included in the request is expired (AWS)ExpiredTokenFailed to serialize user into session — Passport.js: Error: Failed to serialize user into session (Authentication)Failed to serialize u…SameSite …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.