Class CookieData


  • public class CookieData
    extends Object
    Represent a single cookie
    • Constructor Detail

      • CookieData

        public CookieData​(URL url,
                          String key,
                          String value)
        Constructor
        Parameters:
        url - URL associated with this cookie
        key - Cookie name
        value - Cookie value
    • Method Detail

      • getName

        public String getName()
        Get cookie name
        Returns:
        The cooke name
      • getValue

        public String getValue()
        Get cookie value (the cookie "text")
        Returns:
        The value
      • setPath

        public void setPath​(String path)
        Save the path
      • getPath

        public String getPath()
        Get the path
        Returns:
        The cooke path attribute value (null if none)
      • setExpires

        public void setExpires​(String expires)
        Save the expiration date
      • getExpires

        public String getExpires()
        Get the expiration date
        Returns:
        The expires attribute value (null if none)
      • setDomain

        public void setDomain​(String domain)
        Save the domain
      • getDomain

        public String getDomain()
        Get the domain
        Returns:
        The domain attribute value (null if none)
      • setVersion

        public void setVersion​(String version)
        Save the version
      • getVersion

        public String getVersion()
        Get the cookie version
        Returns:
        The version (null if none)
      • setMaxAge

        public void setMaxAge​(String maxAge)
        Set the maximum age for this cookie
      • getMaxAge

        public int getMaxAge()
        Get the maximum age for this cookie
      • setSecure

        public void setSecure​(boolean secure)
        Save security setting (true if cookie to be sent only via HTTPS)
      • getSecure

        public boolean getSecure()
      • equals

        public boolean equals​(CookieData cookie)
        Equal cookies?
        Parameters:
        cookie - for comparison
        Returns:
        true if cookie name, path, and domain are all equal