Join our Newsletter — 33% off our NHI Course
Home› FAQ› Authentication, Authorisation & Trust› What are the key SameSite Cookie best practices?
Authentication, Authorisation & Trust

What are the key SameSite Cookie best practices?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 19, 2026 Domain: Authentication, Authorisation & Trust

Set cookies with the most restrictive SameSite value that still supports the intended user journey, usually Lax or Strict for session cookies. Use Secure and HttpOnly where appropriate, and review any cross-site authentication or payment flow because overly permissive cookies increase CSRF exposure and session misuse.

SameSite is a browser-side cookie attribute that limits when cookies are sent on cross-site requests. For session cookies, the key practice is to choose the least permissive value that still supports the real user journey. That usually means Lax or Strict, with exceptions only where a specific cross-site flow genuinely depends on cookie continuity.

The practical distinction is simple: Strict gives the strongest CSRF resistance but can break common navigation patterns, while Lax usually preserves top-level navigation while still reducing ambient cross-site cookie sending. That makes the attribute a security and usability trade-off, not a checkbox to set once and forget.

Apply SameSite together with Secure and HttpOnly where the cookie carries authenticated state or other sensitive session material. Secure keeps the cookie off plain HTTP, while HttpOnly reduces exposure to script-based theft. SameSite reduces where the browser will attach the cookie, but it does not replace session hardening, expiry, or server-side authorization checks.

For browser-based applications, review which cookies actually need cross-site behavior. Authentication cookies, CSRF-sensitive session cookies, and high-value state should usually be scoped as tightly as possible, while only narrowly defined exceptions should be allowed for external redirects, embedded sign-in steps, or payment handoffs that depend on third-party navigation.

Where SameSite breaks, and how to handle the exceptions

Cross-site authentication, identity federation, embedded payment pages, and third-party widgets are the usual places where teams discover that a stricter cookie setting disrupts the flow. In those cases, the right response is not to make every cookie permissive, but to isolate the specific cookie or endpoint that needs the broader behavior.

When a flow truly requires cross-site cookies, keep the exception as narrow as possible and document why it exists. Validate the browser behavior in the exact journey, because some breakage only appears after redirects, iframe embedding, or third-party handoffs rather than on a normal single-site test path.

Risk and Threat Considerations

Overly permissive SameSite settings increase the likelihood that a browser will attach authenticated cookies in contexts where the application did not intend them, which raises CSRF exposure and can make session misuse easier. The main danger is not just direct theft, but an attacker steering the victim’s browser into sending a trusted request.

Failure mechanism: If a session cookie is sent on cross-site requests more often than necessary, a malicious site or embedded context can trigger state-changing actions using the victim’s existing authentication context. Weak cookie scoping becomes a trust-boundary problem at the browser level.

Impact: The result can be unauthorized actions, account abuse, or session confusion even when passwords and MFA are intact. In higher-value flows, the blast radius can include payment actions, account settings changes, or delegated access abuse.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV7 — Session ManagementSameSite cookie handling is part of session protection and browser session behavior.
V8 — AuthorizationCookie-driven cross-site requests can trigger unauthorized state changes without proper request authorization.
Recommendation — Set session cookies to the strictest SameSite mode that still supports the required user flow. Require server-side authorization checks on every state-changing request, regardless of cookie presence.
NIST SP 800-53 Rev 5SC-23 — Session AuthenticityCookie misuse and cross-site request abuse directly affect session trust and authenticity.
IA-5 — Authenticator ManagementSensitive cookies are credential-like session material that needs lifecycle and protection controls.
Recommendation — Validate session authenticity assumptions and limit when authenticated cookies are accepted. Protect session cookies with secure storage, limited exposure, and defined expiration.
CIS Controls v8CIS-16 — Application Software SecurityCookie attributes are an application security control that should be reviewed and tested.
Recommendation — Review cookie handling during application security testing and harden cross-site flows.

Practitioner Guidance

What to verify: Test the real browser journey, not just the login page. A cookie setting is only acceptable if it supports the exact navigation, redirect, and post-authentication sequence that users actually follow without expanding cross-site exposure unnecessarily.

Decision rule: If a cookie does not need to survive a cross-site context, set it to the strictest viable SameSite mode and keep the exception list small. If a cross-site flow is business-critical, document the exception, scope it to the minimum cookie or endpoint, and confirm that compensating controls still block forged state changes.

Practitioner takeaway: Treat SameSite as a boundary control for browser trust, not as a substitute for CSRF defenses and session hardening. The best setting is the one that preserves the intended flow while removing every unnecessary cross-site path for authenticated cookies.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 19, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org