Skip to content

SameSite cookie

SameSite affects cookie inclusion in cross-site requests. The choice must fit login and navigation flows; CSRF protection remains necessary.

IT security

The cookie attribute SameSite controls inclusion in requests between different sites. This classification uses the scheme and registrable domain. A site is not the same as an origin with its full host and port. Thus https://portal.example.com and https://api.example.com are the same site but different origins. This alone does not let browser code read the API response.

Consider navigation in the portal design

A fictional portal considers entry through a link on another website. With SameSite=Strict, the session cookie is not sent on this cross-site entry. Explicitly setting SameSite=Lax allows the cookie to be sent during top-level navigation with a safe method such as GET, subject to the other cookie conditions. This does not automatically include the cookie in embedded requests or arbitrary state-changing calls.

With SameSite=None, this SameSite restriction is removed; Secure is additionally required. Other cookie conditions remain. The attribute adds protection against certain CSRF attacks; it does not replace suitable CSRF defenses or server-side permission checks.

The team must check login, return flows and any embedding within the planned process. No single choice for every portal is prescribed here.

Sources