Enum Class SameSite

java.lang.Object
java.lang.Enum<SameSite>
io.micronaut.http.cookie.SameSite
All Implemented Interfaces:
Serializable, Comparable<SameSite>, Constable

public enum SameSite extends Enum<SameSite>
Asserts that a cookie must not be sent with cross-origin requests, providing some protection against cross-site request forgery attacks (CSRF). Possible values for the SameSite attribute. See changes to RFC6265bis
Since:
1.3.4
Author:
croudet
  • Enum Constant Details

    • Lax

      public static final SameSite Lax
      The cookie will be sent along with the GET request initiated by third party website.
    • Strict

      public static final SameSite Strict
      When the SameSite attribute is set as Strict, the cookie will not be sent along with requests initiated by third party websites.
    • None

      public static final SameSite None
      Allows third-party cookies to track users across sites. The None directive requires the Secure attribute.
  • Method Details

    • values

      public static SameSite[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SameSite valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null