public interface Cookie
Modifier and Type | Method and Description |
---|---|
long |
getCreationTime()
Returns cookie creation time in microseconds since Windows epoch.
返回自Windows时代以来的cookie创建时间(以微秒为单位)。 |
java.lang.String |
getDomain()
Returns the domain name set for this cookie.
返回为此Cookie设置的域名。 |
long |
getExpirationTime()
Returns cookie expiration time in microseconds since Windows epoch.
返回自Windows时代以来的cookie过期时间(以微秒为单位)。 |
java.lang.String |
getName()
Returns the name of the cookie.
返回cookie的名称。 |
java.lang.String |
getPath()
Returns the path on the server to which the browser returns this cookie.
返回浏览器向其返回此cookie的服务器上的路径。 |
long |
getUnixCreationTime()
Returns cookie creation time in seconds since UNIX epoch.
返回自UNIX时代以来的cookie创建时间(以秒为单位)。 |
long |
getUnixExpirationTime()
Returns cookie expiration time in seconds since UNIX epoch.
返回自UNIX时代以来以秒为单位的cookie过期时间。 |
java.lang.String |
getValue()
Returns the value of the cookie.
返回cookie的值。 |
boolean |
isHTTPOnly()
Returns
如果此cookie包含HttpOnly属性,则返回true。 true if this cookie contains the
HttpOnly attribute.
|
boolean |
isSecure()
Returns
如果发送此cookie应限于安全协议,则返回true;如果可以使用任何协议发送,则返回false。 true if sending this cookie should be restricted to a secure protocol, or
false if the it can be sent using any protocol.
|
boolean |
isSession()
Returns
如果此cookie是没有到期时间的会话cookie,则返回true;如果此cookie是具有到期时间的持久cookie,则返回false。 true if this cookie is a session cookie without expiration time and
false if this cookie is a persistent cookie that has expiration time.
|
java.lang.String getName()
String
specifying the cookie's name.
指定cookie的名称。
java.lang.String getValue()
String
containing the cookie's present value.
包含cookie的现值。
java.lang.String getDomain()
String
containing the domain name.
包含域名。
java.lang.String getPath()
String
specifying a path that contains a servlet name, for example,
/catalog.
指定包含servlet名称的路径,例如。
long getCreationTime()
long getUnixCreationTime()
long getExpirationTime()
long getUnixExpirationTime()
boolean isSecure()
true
if sending this cookie should be restricted to a secure protocol, or
false
if the it can be sent using any protocol.
false
if the cookie can be sent over any standard protocol; otherwise,
true
.
cookie是否可以通过任何标准协议发送;除此以外, 。
boolean isHTTPOnly()
true
if this cookie contains the
HttpOnly attribute. This means that the cookie should not be accessible to scripting engines, like javascript.
true
if this cookie should be considered http only.
如果此cookie仅应视为http。
boolean isSession()
true
if this cookie is a session cookie without expiration time and
false
if this cookie is a persistent cookie that has expiration time.