OneWebDesk

SameSite Cookie Matrix

See how SameSite=Strict/Lax/None behave across cross-site flows like login and checkout.

A cookie's SameSite attribute decides whether the cookie travels along with requests that originate from other sites. The three values — Strict, Lax and None — behave differently per scenario and are easy to mix up. This tool shows an at-a-glance matrix of whether the cookie is sent for cross-site situations like clicking a link, a form POST, an iframe, or a fetch/XHR.

You can also pick a SameSite value to generate and copy a real Set-Cookie header example. To confirm how the header actually ships, inspect your response cookies with Cookie Security Check and audit the full set with Security Headers Checker.

SameSite behavior matrix
Cross-site scenarioStrictLaxNone (+Secure)
Top-level navigation GET (clicking a link)Not sentSentSent
Cross-site form POSTNot sentNot sentSent
Cross-site iframe / embedded resourceNot sentNot sentSent
Cross-site fetch / XHRNot sentNot sentSent
Set-Cookie header example
Set-Cookie: session=...; SameSite=Lax; Secure; HttpOnly
Lax is the default in modern browsers and mitigates most CSRF.

The three SameSite values

Each value limits how widely the cookie is sent on cross-site requests.

  • Strict: sent only on same-site requests. Even arriving via a link from another site won't include it.
  • Lax: sent only on top-level navigation GETs (clicking a link). Not sent on cross-site POST, iframe, or fetch.
  • None: sent on all cross-site requests, but it must be paired with Secure (HTTPS).

Defaults and when to use None

Modern browsers treat a cookie with no explicit SameSite as Lax by default, so most CSRF is mitigated out of the box. Reach for SameSite=None; Secure only when another site genuinely needs the cookie — payment widgets, cross-domain embeds, or third-party authentication.

  • If SameSite=None is set without Secure, modern browsers reject the cookie.
  • For session cookies, also add HttpOnly to block JavaScript access.
  • Example: Set-Cookie: session=...; SameSite=Lax; Secure; HttpOnly

Which SameSite to choose per use case

The scenarios you actually hit in production, the value to pick, and why.

Use caseRecommendedWhy
Same-site session / CSRF defenseLax or StrictThe cookie is withheld from cross-site POST and fetch, sharply reducing CSRF. For most ordinary web apps Lax is enough.
SSO / OAuth redirect that needs the cookie after cross-site navigationLaxThe cookie is sent on top-level GET navigation, so the redirect coming back from an external identity provider works correctly.
Embedded third-party widget / iframe that needs cookiesNone (Secure required)Cookies must travel on iframe and cross-site requests, so None is the only option — and it must be served over HTTPS with Secure.
Highest CSRF safetyStrictNot even the first request arriving from another site carries the cookie. The trade-off: inbound links can make a logged-in user appear logged out, hurting usability.

Worked example: a payment iframe losing its session

Suppose a shop opens a third-party payment provider in an iframeat checkout, but every time the payment screen loads the user's session disappears as if they were logged out. Inspecting the response, the session cookie ships as Set-Cookie: pgsession=abc; SameSite=Lax; Secure.

  • Symptom: the login state is not preserved only inside the payment iframe.
  • Cause: an iframe is a cross-site context, so a Lax cookie is not sent. (Leaving the attribute unset behaves the same, since browsers default to Lax.)
  • Fix: change it to Set-Cookie: pgsession=abc; SameSite=None; Secure so the cookie is sent on the cross-site iframe and the session persists.

Frequently asked questions

What happens if I don't set SameSite?
Modern browsers (Chrome 80+ and others) treat a cookie with no SameSite as Lax by default. It is sent on top-level GETs like clicking a link, but not on cross-site POSTs or iframes.
What does SameSite=None require?
It must be served over HTTPS with the Secure attribute. A SameSite=None cookie without Secure is ignored or rejected by modern browsers.
What's the practical difference between Strict and Lax?
Strict withholds the cookie even on the first request when you follow a link from another site, which can make the user appear logged out. Lax sends the cookie on top-level navigation GETs to keep usability while still blocking cross-site POSTs.
Does SameSite alone fully prevent CSRF?
Lax/Strict greatly reduce CSRF but are not a complete defense. Account for GET-based state changes, some older browsers, and same-site attacks by also using CSRF tokens or similar protections.
Are my inputs sent to a server?
No. The matrix and the Set-Cookie example are computed entirely in your browser, and the value you select is never transmitted or stored anywhere.

Related tools

Web Security