Class HttpCookie


  • public class HttpCookie
    extends Object
    Represents a RFC 6265 cookie.
    • Constructor Detail

      • HttpCookie

        public HttpCookie​(@Nonnull
                          String name,
                          @Nonnull
                          String value,
                          @Nullable
                          String path,
                          @Nullable
                          String domain,
                          @Nullable
                          String expires,
                          @Nullable
                          Integer maxAge,
                          @Nullable
                          Boolean secure,
                          @Nullable
                          Boolean httpOnly)
        Constructs a new fully specified cookie.
        Parameters:
        name - the name of the cookie.
        value - the value of the cookie.
        path - the path within the domain to which this cookie belongs.
        domain - the domain to which this cookie belongs.
        expires - when the cookie expires.
        maxAge - how long the cookie can live for.
        secure - whether or not this cookie can only be sent to HTTPS servers.
        httpOnly - whether or not this cookie can only be read by a server.
    • Method Detail

      • getName

        @Nonnull
        public String getName()
        Returns the name of the cookie.
        Returns:
        the name of the cookie.
      • getValue

        @Nonnull
        public String getValue()
        Returns the value of the cookie.
        Returns:
        the value of the cookie.
      • getPath

        @Nullable
        public String getPath()
        Returns the path within the domain to which this cookie belongs.
        Returns:
        the path within the domain to which this cookie belongs.
      • getDomain

        @Nullable
        public String getDomain()
        Returns the domain to which this cookie belongs.
        Returns:
        the domain to which this cookie belongs.
      • getExpires

        @Nullable
        public String getExpires()
        Returns when the cookie expires.
        Returns:
        when the cookie expires.
      • getMaxAge

        @Nullable
        public Integer getMaxAge()
        Returns how long the cookie can live for.
        Returns:
        how long the cookie can live for.
      • isSecure

        @Nullable
        public Boolean isSecure()
        Returns whether or not this cookie can only be sent to HTTPS servers.
        Returns:
        whether or not this cookie can only be sent to HTTPS servers.
      • isHttpOnly

        @Nullable
        public Boolean isHttpOnly()
        Returns whether or not this cookie can only be read by a server.
        Returns:
        whether or not this cookie can only be read by a server.