Class Cookie

java.lang.Object
jakarta.servlet.http.Cookie
All Implemented Interfaces:
Serializable, Cloneable

public class Cookie extends Object implements Cloneable, Serializable
The Cookie API.
See Also:
  • Constructor Details

    • Cookie

      public Cookie(String name, String value)
      Constructor.
      Parameters:
      name - the name.
      value - the value.
  • Method Details

    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • getComment

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

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

      public int getMaxAge()
      Returns the max age.
      Returns:
      the max age
    • getName

      public String getName()
      Returns the name.
      Returns:
      the name
    • getPath

      public String getPath()
      Returns the path.
      Returns:
      the path
    • getSecure

      public boolean getSecure()
      Returns the secure flag.
      Returns:
      the secure flag
    • getValue

      public String getValue()
      Returns the value.
      Returns:
      the value
    • getVersion

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

      public boolean isHttpOnly()
      Is HTTP only.
      Returns:
      true if it is, false otherwise.
    • setComment

      public void setComment(String comment)
      Set the comment.
      Parameters:
      comment - the comment.
    • setDomain

      public void setDomain(String domain)
      Set the domain.
      Parameters:
      domain - the domain.
    • setHttpOnly

      public void setHttpOnly(boolean httpOnly)
      Set the HTTP only flag.
      Parameters:
      httpOnly - the HTTP only flag.
    • setMaxAge

      public void setMaxAge(int maxAge)
      Set the max age.
      Parameters:
      maxAge - the max age.
    • setPath

      public void setPath(String path)
      Set the path.
      Parameters:
      path - the path.
    • setSecure

      public void setSecure(boolean secure)
      Set the secure flag.
      Parameters:
      secure - the secure flag.
    • setValue

      public void setValue(String value)
      Set the value.
      Parameters:
      value - the value.
    • setVersion

      public void setVersion(int version)
      Set the version.
      Parameters:
      version - the version.