Package javax.servlet.http
Class Cookie
- java.lang.Object
-
- javax.servlet.http.Cookie
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class Cookie extends Object implements Cloneable, Serializable
The Cookie API.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Clones the cookie.String
getComment()
Get the comment.String
getDomain()
Get the domain.int
getMaxAge()
Get the max age.String
getName()
Get the name.String
getPath()
Get the path.boolean
getSecure()
Get the secure flag.String
getValue()
Get the value.int
getVersion()
Get the version.boolean
isHttpOnly()
Is HTTP only.void
setComment(String comment)
Set the comment.void
setDomain(String domain)
Set the domain.void
setHttpOnly(boolean httpOnly)
Set the HTTP only flag.void
setMaxAge(int maxAge)
Set the max age.void
setPath(String path)
Set the path.void
setSecure(boolean secure)
Set the secure flag.void
setValue(String value)
Set the value.void
setVersion(int version)
Set the version.
-
-
-
Method Detail
-
getComment
public String getComment()
Get the comment.- Returns:
- the comment.
-
getDomain
public String getDomain()
Get the domain.- Returns:
- the domain.
-
getMaxAge
public int getMaxAge()
Get the max age.- Returns:
- the max age.
-
getName
public String getName()
Get the name.- Returns:
- the name.
-
getPath
public String getPath()
Get the path.- Returns:
- the path.
-
getSecure
public boolean getSecure()
Get the secure flag.- Returns:
- the secure flag.
-
getValue
public String getValue()
Get the value.- Returns:
- the value.
-
getVersion
public int getVersion()
Get 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.
-
-