Package ej.hoka.http
Enum Cookie.SameSite
- java.lang.Object
-
- java.lang.Enum<Cookie.SameSite>
-
- ej.hoka.http.Cookie.SameSite
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Cookie.SameSite>
- Enclosing class:
- Cookie
public static enum Cookie.SameSite extends java.lang.Enum<Cookie.SameSite>
Same site values.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LaxThe cookie is not sent on cross-site requests, such as calls to load images or frames, but is sent when a user is navigating to the origin site from an external site (e.g.NoneThe browser sends the cookie with both cross-site and same-site requests.StrictThe browser sends the cookie only for same-site requests (that is, requests originating from the same site that set the cookie).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Cookie.SameSitevalueOf(java.lang.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.
-
-
-
Enum Constant Detail
-
Strict
public static final Cookie.SameSite Strict
The browser sends the cookie only for same-site requests (that is, requests originating from the same site that set the cookie). If the request originated from a different URL than the current one, no cookies with the SameSite=Strict attribute are sent.
-
Lax
public static final Cookie.SameSite Lax
The cookie is not sent on cross-site requests, such as calls to load images or frames, but is sent when a user is navigating to the origin site from an external site (e.g. if following a link). This is the default behavior if the SameSite attribute is not specified.
-
None
public static final Cookie.SameSite None
The browser sends the cookie with both cross-site and same-site requests. The Secure attribute must also be set when SameSite=None!
-
-
Method Detail
-
values
public static Cookie.SameSite[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Cookie.SameSite c : Cookie.SameSite.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Cookie.SameSite valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-