CSRF
samesite vs sameorigin
from mozilla
The possible attribute values are:
Send the cookie only for requests originating from the same site that set the cookie.
Send the cookie only for requests originating from the same site that set the cookie, and for cross-site requests that meet both of the following criteria:
The request is a top-level navigation: this essentially means that the request causes the URL shown in the browser's address bar to change.
It would include requests made when the user clicks a link in the top-level browsing context from one site to another, or an assignment to
document.location
, or a<form>
submission.
Some browsers use Lax
as the default value if SameSite
is not specified: see Browser compatibility for details.
Note: When Lax
is applied as a default, a more permissive version is used. In this more permissive version, cookies are also included in POST
requests, as long as they were set no more than two minutes before the request was made.
Send the cookie with both cross-site and same-site requests. The Secure
attribute must also be set when using this value.
Last updated