Decloak is an AI-powered web security intelligence platform that scans a site's HTTP/TLS posture, JavaScript, and third-party scripts to produce a report anyone can read. This guide is part of Decloak's library of practical, source-backed security guidance.
In this guide
- Key takeaways
- Why does a missing SameSite attribute matter?
- How do modern browsers handle cookies without SameSite?
- Which browsers still send cookies unrestricted?
- What is the security impact of the Lax default?
- How to check whether your cookies have SameSite set?
- How to add the attribute correctly?
- Comparison of cookie behavior by browser version
- Should I rely on the default Lax behavior?
- Steps to remediate missing SameSite attributes
- When is `SameSite=None; Secure` appropriate?
- What about cookies used in APIs?
- Final recommendation
Key takeaways
- Modern browsers treat cookies without a SameSite attribute as
SameSite=Lax. - Legacy browsers may still send such cookies on every request, exposing you to CSRF.
- Explicitly set
SameSite=LaxorStricton all first - party cookies; useSameSite=None; Secureonly for genuine cross - site use cases. - Verify the attribute with a simple curl command or browser dev tools.
Why does a missing SameSite attribute matter?
A missing SameSite attribute no longer means the cookie is unrestricted; browsers now apply a Lax default, which blocks most cross - site sub - resource requests. This change directly impacts CSRF defenses and how your session persists across navigation.
How do modern browsers handle cookies without SameSite?
All browsers released after 2020 (Chrome 80+, Edge 80+, Firefox 69+, Safari 13+) interpret the absence of the attribute as SameSite=Lax. The cookie is sent on same - site requests and on top - level cross - site navigations that use safe HTTP methods (GET, HEAD, OPTIONS, TRACE). It is omitted from cross - site fetches, iframes, XHR/fetch calls, and POST forms.
Which browsers still send cookies unrestricted?
Older browsers that pre - date the Lax - by - default change (e.g., Chrome < 80, Firefox < 69) treat a missing attribute as "no restriction" and include the cookie on every request, which can be abused for CSRF attacks.
What is the security impact of the Lax default?
Because the default is Lax, most cross - site POST - based CSRF attacks are blocked while users can still follow external links and stay logged in. However, if an attacker can trigger a top - level navigation (e.g., a link click), the cookie will be sent and the session may be hijacked if other defenses are missing.
How to check whether your cookies have SameSite set?
# Use curl to view Set - Cookie headers
curl -I https://example.com | grep Set-Cookie
In Chrome DevTools, open the Application tab, expand Cookies, and look for the SameSite column. If the column shows "Lax" for a cookie that you did not set, the browser applied the default.
How to add the attribute correctly?
Set-Cookie: sessionId=abc123; Path=/; HttpOnly; Secure; SameSite=Lax
- Use
SameSite=Strictfor the highest protection when the cookie never needs to be sent to another site. - Use
SameSite=None; Secureonly for third - party widgets, SSO, or embeds that require the cookie in all contexts. - Always include
Securewhen usingSameSite=Noneto satisfy browser enforcement.
Comparison of cookie behavior by browser version
| Browser | Version where Lax default applies | Behavior without SameSite |
|---|---|---|
| Chrome | 80+ | Lax (sent on top - level GET navigation only) |
| Edge | 80+ | Lax |
| Firefox | 69+ | Lax |
| Safari | 13+ | Lax |
| Legacy (e.g., Chrome 79) | <80 | No restriction (sent on every request) |
Should I rely on the default Lax behavior?
No. Relying on the default makes your intent unclear and can cause inconsistent behavior in older browsers. Explicitly setting the attribute removes ambiguity and satisfies security scanners that flag missing SameSite as a low - severity issue.
Steps to remediate missing SameSite attributes
- Identify all
Set - Cookieheaders without a SameSite value using curl or browser dev tools. - Classify each cookie: first - party session cookies, third - party tokens, or static preferences.
- Update server - side cookie generation code to include
SameSite=Laxfor first - party cookies. - For any cookie that must be sent in cross - site contexts, add
SameSite=None; Secure. - Deploy the changes and re - run a security scan to verify the issue is resolved.
When is SameSite=None; Secure appropriate?
Use this combination only when the cookie is required by a third - party service that operates on a different domain, such as an SSO provider, payment gateway, or analytics widget. Ensure the cookie is transmitted over HTTPS to satisfy the Secure requirement.
What about cookies used in APIs?
API authentication cookies should almost always be SameSite=Strict or Lax to prevent them from being sent with cross - site requests. If an API is accessed from a JavaScript client on a different domain, prefer token - based authentication (e.g., Bearer tokens) over cookies.
Final recommendation
Always set the SameSite attribute explicitly. Choose Lax for typical session cookies, Strict for high - security contexts, and None; Secure only when cross - site usage is required. Verify the change across browsers and re - scan with Decloak to ensure no missing flags remain.
Related guides
What does SameSite do in cookies?
SameSite tells browsers when to send a cookie, protecting against CSRF and cross - site tracking. Choose Strict, Lax, or None + Secure and test your flows to avoid breaks.
What is the difference between SameSite Lax and SameSite None cookies?
SameSite=Lax blocks cookies on most cross - site requests while allowing link navigation, whereas SameSite=None sends cookies everywhere but requires the Secure flag. Choose the right setting to balance CSRF protection and cross - origin functionality.
Is SameSite=None safe?
SameSite=None does not provide built - in CSRF protection; it only forces the Secure flag, so it must be used with HTTPS and additional defenses.