Class Cookie


  • public class Cookie
    extends Object
    Container for HTTP cookies used to track session state.
    • Constructor Detail

      • Cookie

        public Cookie​(String name,
                      String value)
        Create a new cookie with the supplied name/value pair
        Parameters:
        name -
        value -
    • Method Detail

      • getName

        public String getName()
        Get the name of this cookie
        Returns:
        cookie name
      • setValue

        public void setValue​(String value)
        Change the value of this cookie
        Parameters:
        value -
      • getValue

        public String getValue()
        Get the value of this cookie
        Returns:
        cookie value
      • setPath

        public void setPath​(String path)
        Set the path of this cookie
        Parameters:
        path -
      • getPath

        public String getPath()
        Get the path of this cookie
        Returns:
        cookie path
      • setMaxAge

        public void setMaxAge​(int maxAge)
        Set the max-age of this cookie. If set to 0, it should be removed from the session.
        Parameters:
        maxAge -
      • getMaxAge

        public int getMaxAge()
        Get the max-age of this cookie
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • requestCookieHeader

        public String requestCookieHeader()
        Convert a list of cookies into a string suitable for sending as a "Cookie:" header
        Returns:
        Cookie header text