Class HttpCookie


  • public class HttpCookie
    extends Object
    • Constructor Detail

      • HttpCookie

        public HttpCookie​(String name,
                          String value)
      • HttpCookie

        public HttpCookie​(String name,
                          String value,
                          long maxAge)
      • HttpCookie

        public HttpCookie​(String name,
                          String value,
                          String domain,
                          String path,
                          long maxAge,
                          boolean httpOnly,
                          boolean secure)
      • HttpCookie

        public HttpCookie​(String name,
                          String value,
                          String domain,
                          String path,
                          long maxAge,
                          boolean httpOnly,
                          boolean secure,
                          String comment,
                          int version)
    • Method Detail

      • getName

        public String getName()
        Returns:
        the cookie name
      • getValue

        public String getValue()
        Returns:
        the cookie value
      • getComment

        public String getComment()
        Returns:
        the cookie comment
      • getDomain

        public String getDomain()
        Returns:
        the cookie domain
      • getMaxAge

        public long getMaxAge()
        Returns:
        the cookie max age in seconds
      • getPath

        public String getPath()
        Returns:
        the cookie path
      • isSecure

        public boolean isSecure()
        Returns:
        whether the cookie is valid for secure domains
      • getVersion

        public int getVersion()
        Returns:
        the cookie version
      • isHttpOnly

        public boolean isHttpOnly()
        Returns:
        whether the cookie is valid for the http protocol only
      • isExpired

        public boolean isExpired​(long timeNanos)
        Parameters:
        timeNanos - the time to check for cookie expiration, in nanoseconds
        Returns:
        whether the cookie is expired by the given time
      • asString

        public String asString()
        Returns:
        a string representation of this cookie