public static enum Cookie.SameSite extends Enum<Cookie.SameSite>
Enum Constant and Description |
---|
LAX
In "lax" mode the cookie will be sent on "safe" top-level navigation methods (GET, HEAD, TRACE or OPTIONS).
|
NONE
Some browsers are moving to marking all cookies as
SameSite=lax by default and allowing SameSite=none as an option to turn that off. |
STRICT
In "strict" mode the cookie will not be sent unless the request originates from the same origin.
|
Modifier and Type | Method and Description |
---|---|
static Cookie.SameSite |
parse(String value)
Parses the given SameSite value.
|
String |
toString() |
static Cookie.SameSite |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Cookie.SameSite[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Cookie.SameSite STRICT
public static final Cookie.SameSite LAX
public static final Cookie.SameSite NONE
SameSite=lax
by default and allowing SameSite=none
as an option to turn that off. This is only supported when cookies are also marked as
secure so setting this option will also mark the cookie as secure.
Note: older versions of Safari (prior to version 13) will interpret SameSite=none
as if it was SameSite=strict
, so browser sniffing may be required when setting this option.public static Cookie.SameSite[] values()
for (Cookie.SameSite c : Cookie.SameSite.values()) System.out.println(c);
public static Cookie.SameSite valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static Cookie.SameSite parse(String value)
value
- the value to parse.null
if the value does not match any known setting.public String toString()
toString
in class Enum<Cookie.SameSite>
Copyright © 2010-2018, ForgeRock All Rights Reserved.