public interface Cookie
请勿使用标记为@Obsolete的属性。 它们被RFC 6265废弃了。
| Modifier and Type | Method and Description |
|---|---|
String |
getComment()
返回描述此Cookie目的的注释,如果未定义此类注释,则返回
null 。
|
String |
getCommentURL()
如果用户代理(Web浏览器)向用户显示此Cookie,则Cookie的用途将由此URL上的信息描述。
|
String |
getDomain()
返回cookie的域属性。
|
Date |
getExpiryDate()
返回到期 Date的cookie,或者null如果不存在。
|
String |
getName()
返回名称。
|
String |
getPath()
返回cookie的路径属性。
|
int[] |
getPorts()
获取端口属性。
|
String |
getValue()
返回值。
|
int |
getVersion()
返回此cookie符合的cookie规范的版本。
|
boolean |
isExpired(Date date)
如果此cookie已过期,则返回true。
|
boolean |
isPersistent()
返回 false如果cookie应该在“会话”结尾处丢弃;
true否则。
|
boolean |
isSecure()
指示此Cookie是否需要安全连接。
|
String getName()
String getValue()
Date getExpiryDate()
Date的cookie,或者null如果不存在。
注意:该方法返回的对象被认为是不可变的。 更改它(例如使用setTime())可能会导致未定义的行为。 这样做是为了你的危险。
Date或null 。
boolean isPersistent()
false如果该cookie应该在“会话”结尾处丢弃;
true否则。
false如果cookie应该在“会话”结尾处丢弃;
true否则
String getDomain()
String getPath()
@Obsolete int[] getPorts()
boolean isSecure()
true如果该cookie只能通过安全连接发送,否则为
false 。
@Obsolete int getVersion()
boolean isExpired(Date date)
date - 当前时间
true如果cookie已经过期。
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.