SameSite Cookies Enforce a Site Boundary, Not an Origin Boundary
An application at https://accounts.example.com uses a session cookie marked SameSite=Strict. A separate service at https://reports.example.com is operated by another team and has a distinct origin. The two hosts are isolated by the browser’s origin model for many web capabilities, yet a request from one can still be classified as same-site with the other. The cookie attribute is enforcing a site boundary, not duplicating the same-origin policy.
That distinction is central to the security value of SameSite. The attribute can suppress ambient cookie credentials on requests classified as cross-site, reducing exposure to cross-site request forgery and related unwanted credential attachment. It does not turn every sibling hostname into an external requester. A deployment that treats subdomain separation as an origin-level trust boundary can therefore assign more protection to SameSite than the mechanism provides.
Cookie delivery uses a site classification
Current cookie specifications define same-site request processing through a site concept rather than simple hostname equality. The calculation incorporates the request context and the client’s site for cookies. Modern schemeful same-site processing also distinguishes schemes, so http://example.com and https://example.com do not automatically occupy the same site merely because their registrable domain matches.
This classification is broader than an origin. Web origins include scheme, host, and port. Two HTTPS applications on sibling hosts can be cross-origin while remaining same-site. Likewise, changing a port changes an origin but does not by itself create a different site for cookie enforcement.
The resulting boundary has a concrete operational effect. SameSite=Strict prevents a cookie from being sent with cross-site requests, but it does not withhold that cookie merely because the initiating document belongs to a different origin. If that origin remains inside the same site classification, the SameSite gate does not supply origin isolation.
Strict and Lax change attachment conditions
A cookie marked SameSite=Strict is restricted to same-site requests under the user agent’s applicable processing rules. This is the narrowest of the standard SameSite modes and can interfere with flows that intentionally arrive from another site, including some federated sign-in return paths.
SameSite=Lax permits same-site delivery and also permits selected cross-site top-level navigations under the specification’s retrieval rules. This makes it less restrictive than Strict for navigation-driven flows. The precise request method and navigation context matter; treating Lax as a synonym for “never sent cross-site” produces an incorrect security model.
SameSite=None permits cookie delivery in both same-site and cross-site contexts, subject to the other cookie matching rules. Contemporary processing requires cookies asserting SameSite=None to satisfy the associated secure-cookie requirement. The attribute does not override domain, path, expiry, or secure-transport constraints.
These modes control browser attachment of cookie state. They do not prove that a request was intentionally generated by the application, and they do not carry an authenticated statement about the initiating JavaScript principal.
Sibling origins can sit inside the credential boundary
Consider app.example.com and uploads.example.com. They may have separate codebases, deployment pipelines, administrators, and vulnerability exposure. Browser origin isolation reflects their different hosts. Site classification can still place both under the same registrable-domain site when the relevant schemes align.
If uploads.example.com becomes attacker-controlled through a service misconfiguration, abandoned DNS target, or application compromise, requests it initiates toward app.example.com can occupy a different security position from requests originating at an unrelated domain. A SameSite=Strict session cookie is not a general defense against hostile content that already operates inside the same site.
This makes subdomain governance part of cookie security architecture. A parent namespace containing untrusted tenants, delegated services, temporary campaign hosts, or externally managed applications should not be modeled as a single trusted application merely because its sensitive cookies use SameSite.
The issue is not that the attribute fails its contract. The contract is narrower: it constrains cross-site cookie delivery. The failure appears when an architecture substitutes that contract for an origin boundary it never supplied.
Domain scope and SameSite solve different problems
The Domain attribute controls which hosts can receive a cookie. A host-only cookie, created without Domain, is sent only to the host that set it under the cookie matching rules. A domain cookie can be eligible for subordinate hosts as well.
SameSite applies a different filter. A host-only session cookie for app.example.com is not sent to uploads.example.com, but a request initiated from uploads.example.com toward app.example.com can still be same-site. The destination host can therefore receive its own host-only cookie on that request if all other conditions permit delivery.
This distinction is easy to miss because both mechanisms involve domain names. Cookie domain matching determines the destination hosts eligible to receive stored state. Same-site processing evaluates request context for an additional delivery restriction. Narrowing Domain does not force sibling initiators to become cross-site, and SameSite does not narrow the cookie’s host scope.
Nested contexts can lose same-site status
Same-site processing is also sensitive to embedding context. The cookie specification calculates a document’s site for cookies using the top-level origin and ancestor chain. If the relevant document hierarchy crosses a site boundary, the calculated site for cookies can become opaque, affecting requests issued from that context.
A same-site iframe therefore cannot be analyzed only from the iframe URL and destination URL. Its ancestor context can alter classification. This matters for widgets, embedded administration surfaces, and applications that assume a sibling hostname always receives the same cookie treatment regardless of where that sibling is embedded.
Worker-based requests have their own site-for-cookies processing in the specification. The broader point remains consistent: SameSite is contextual request policy, not a static comparison between two visible host strings.
CSRF defenses still need the application’s actual trust model
SameSite can remove a large class of cross-site credential attachment before a request reaches server code. That makes it valuable as a browser-enforced defense layer. Its coverage, however, follows the browser’s site model and the selected attribute mode.
Applications with sensitive state changes often need controls that reflect a narrower trust boundary. Anti-forgery tokens can bind a request to application state that a foreign context cannot simply cause the browser to attach. Origin-aware request validation can also distinguish sibling origins where deployment policy requires that separation, provided the application handles header availability and expected request classes correctly.
Those controls address different evidence than SameSite. Combining them is not redundant when the threat model includes untrusted or independently operated sibling origins. One mechanism restricts ambient cookie delivery across sites; another can enforce application-specific authorization for a state-changing request.
A secure design therefore treats SameSite as a request-context filter with explicit scope. Its protection is strongest when the site’s administrative boundary matches the application’s trust boundary. Where a registrable domain contains principals with different security posture, the gap between site and origin becomes an architectural property that server-side request authorization must account for.