Package org.eclipse.jetty.http
Class HttpCookie
- java.lang.Object
-
- org.eclipse.jetty.http.HttpCookie
-
public class HttpCookie extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description HttpCookie(java.lang.String name, java.lang.String value)
HttpCookie(java.lang.String name, java.lang.String value, long maxAge)
HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path)
HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure)
HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure, java.lang.String comment, int version)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString()
java.lang.String
getComment()
java.lang.String
getDomain()
long
getMaxAge()
java.lang.String
getName()
java.lang.String
getPath()
java.lang.String
getValue()
int
getVersion()
boolean
isExpired(long timeNanos)
boolean
isHttpOnly()
boolean
isSecure()
-
-
-
Constructor Detail
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value)
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path)
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, long maxAge)
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure)
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure, java.lang.String comment, int version)
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- the cookie name
-
getValue
public java.lang.String getValue()
- Returns:
- the cookie value
-
getComment
public java.lang.String getComment()
- Returns:
- the cookie comment
-
getDomain
public java.lang.String getDomain()
- Returns:
- the cookie domain
-
getMaxAge
public long getMaxAge()
- Returns:
- the cookie max age in seconds
-
getPath
public java.lang.String getPath()
- Returns:
- the cookie path
-
isSecure
public boolean isSecure()
- Returns:
- whether the cookie is valid for secure domains
-
getVersion
public int getVersion()
- Returns:
- the cookie version
-
isHttpOnly
public boolean isHttpOnly()
- Returns:
- whether the cookie is valid for the http protocol only
-
isExpired
public boolean isExpired(long timeNanos)
- Parameters:
timeNanos
- the time to check for cookie expiration, in nanoseconds- Returns:
- whether the cookie is expired by the given time
-
asString
public java.lang.String asString()
- Returns:
- a string representation of this cookie
-
-