Package alpine.auth

Class 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
    • Constructor Detail

      • 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 Detail

      • 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