Enum wasm_cookies::cookies::SameSite
source · pub enum SameSite {
Lax,
Strict,
None,
}
Expand description
SameSite value for CookieOptions.
SameSite prevents the browser from sending the cookie along with cross-site requests (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_attribute).
Variants§
Lax
The Lax
value value will send the cookie for all same-site requests and top-level navigation GET requests.
This is sufficient for user tracking, but it will prevent many CSRF attacks.
This is the default value when calling SameSite::default()
.
Strict
The Strict
value will prevent the cookie from being sent by the browser to the
target site in all cross-site browsing contexts, even when following a regular link.
None
The None
value explicitly states no restrictions will be applied.
The cookie will be sent in all requests - both cross-site and same-site.