java.lang.Object
jakarta.servlet.http.Cookie
- All Implemented Interfaces:
Serializable
,Cloneable
The Cookie API.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns the comment.Returns the domain.int
Returns the max age.getName()
Returns the name.getPath()
Returns the path.boolean
Returns the secure flag.getValue()
Returns the value.int
Returns the version.boolean
Is HTTP only.void
setComment
(String comment) Set the comment.void
Set the domain.void
setHttpOnly
(boolean httpOnly) Set the HTTP only flag.void
setMaxAge
(int maxAge) Set the max age.void
Set the path.void
setSecure
(boolean secure) Set the secure flag.void
Set the value.void
setVersion
(int version) Set the version.
-
Constructor Details
-
Cookie
Constructor.- Parameters:
name
- the name.value
- the value.
-
-
Method Details
-
clone
-
getComment
Returns the comment.- Returns:
- the comment
-
getDomain
Returns the domain.- Returns:
- the domain
-
getMaxAge
public int getMaxAge()Returns the max age.- Returns:
- the max age
-
getName
Returns the name.- Returns:
- the name
-
getPath
Returns the path.- Returns:
- the path
-
getSecure
public boolean getSecure()Returns the secure flag.- Returns:
- the secure flag
-
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
Set the comment.- Parameters:
comment
- the comment.
-
setDomain
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
Set the path.- Parameters:
path
- the path.
-
setSecure
public void setSecure(boolean secure) Set the secure flag.- Parameters:
secure
- the secure flag.
-
setValue
Set the value.- Parameters:
value
- the value.
-
setVersion
public void setVersion(int version) Set the version.- Parameters:
version
- the version.
-