Class AlpineCookie

java.lang.Object
javax.ws.rs.core.Cookie
javax.ws.rs.core.NewCookie
alpine.server.auth.AlpineCookie
Direct Known Subclasses:
AuthorizationTokenCookie

public class AlpineCookie extends javax.ws.rs.core.NewCookie
Alpine Cookies are secure with the HttpOnly, Secure, and Samesite flags enabled.
Since:
1.5.0
  • Field Summary

    Fields inherited from class javax.ws.rs.core.NewCookie

    DEFAULT_MAX_AGE

    Fields inherited from class javax.ws.rs.core.Cookie

    DEFAULT_VERSION
  • Constructor Summary

    Constructors
    Constructor
    Description
    AlpineCookie(String name, String value)
    Create a new instance.
    AlpineCookie(String name, String value, String path, String domain)
    Create a new instance.
    AlpineCookie(String name, String value, String path, String domain, int maxAge)
    Create a new instance.
    AlpineCookie(String name, String value, String path, String domain, int version, int maxAge)
    Create a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Convert the cookie to a string suitable for use as the value of the corresponding HTTP header.

    Methods inherited from class javax.ws.rs.core.NewCookie

    equals, getComment, getExpiry, getMaxAge, hashCode, isHttpOnly, isSecure, toCookie, valueOf

    Methods inherited from class javax.ws.rs.core.Cookie

    getDomain, getName, getPath, getValue, getVersion

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AlpineCookie

      public AlpineCookie(String name, String value, String path, String domain, int version, int maxAge)
      Create a new instance.
      Parameters:
      name - the name of the cookie.
      value - the value of the cookie.
      path - the URI path for which the cookie is valid.
      domain - the host domain for which the cookie is valid.
      version - the version
      maxAge - the maximum age of the cookie in seconds.
      Throws:
      IllegalArgumentException - if name is null.
      Since:
      1.5.0
    • AlpineCookie

      public AlpineCookie(String name, String value, String path, String domain, int maxAge)
      Create a new instance.
      Parameters:
      name - the name of the cookie.
      value - the value of the cookie.
      path - the URI path for which the cookie is valid.
      domain - the host domain for which the cookie is valid.
      maxAge - the maximum age of the cookie in seconds.
      Throws:
      IllegalArgumentException - if name is null.
      Since:
      1.5.0
    • AlpineCookie

      public AlpineCookie(String name, String value, String path, String domain)
      Create a new instance.
      Parameters:
      name - the name of the cookie.
      value - the value of the cookie.
      path - the URI path for which the cookie is valid.
      domain - the host domain for which the cookie is valid.
      Throws:
      IllegalArgumentException - if name is null.
      Since:
      1.5.0
    • AlpineCookie

      public AlpineCookie(String name, String value)
      Create a new instance.
      Parameters:
      name - the name of the cookie.
      value - the value of the cookie.
      Throws:
      IllegalArgumentException - if name is null.
      Since:
      1.5.0
  • Method Details

    • toString

      public String toString()
      Convert the cookie to a string suitable for use as the value of the corresponding HTTP header.
      Overrides:
      toString in class javax.ws.rs.core.NewCookie
      Returns:
      a stringified cookie.
      Since:
      1.5.0