Class Cookie

java.lang.Object
org.attribyte.api.http.Cookie

public class Cookie extends Object
An immutable HTTP cookie.
  • Field Details

    • name

      public final String name
      The name.
    • value

      public final String value
      The value.
    • domain

      public final String domain
      The domain.
    • path

      public final String path
      The path.
    • maxAgeSeconds

      public final int maxAgeSeconds
      The maximum age in seconds.
    • secure

      public final boolean secure
      Is this cookie sent only if connection is secure?
    • httpOnly

      public final boolean httpOnly
      Is this an http-only cookie?
  • Constructor Details

    • Cookie

      public Cookie(String name, String value, String domain, String path, int maxAgeSeconds, boolean secure, boolean httpOnly)
      Creates a response cookie.
      Parameters:
      name - The name.
      value - The value.
      domain - The domain.
      path - The path.
      maxAgeSeconds - The maximum age in seconds.
      secure - Is the cookie sent only if connection is secure?
      httpOnly - Is the cookie available only through HTTP?
  • Method Details

    • requestCookie

      public static Cookie requestCookie(String name, String value)
      Creates a request cookie.
      Parameters:
      name - The cookie name.
      value - The cookie value.
      Returns:
      The cookie.
    • toString

      public String toString()
      Overrides:
      toString in class Object