public interface Cookie
Please do not use attributes marked as @Obsolete. They have been rendered obsolete by RFC 6265.
| Modifier and Type | Method and Description |
|---|---|
String |
getComment()
Returns the comment describing the purpose of this cookie, or
null if no such comment has been defined. |
String |
getCommentURL()
If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described by the information at this URL.
|
String |
getDomain()
Returns domain attribute of the cookie.
|
Date |
getExpiryDate()
Returns the expiration
Date of the cookie, or null
if none exists. |
String |
getName()
Returns the name.
|
String |
getPath()
Returns the path attribute of the cookie.
|
int[] |
getPorts()
Get the Port attribute.
|
String |
getValue()
Returns the value.
|
int |
getVersion()
Returns the version of the cookie specification to which this
cookie conforms.
|
boolean |
isExpired(Date date)
Returns true if this cookie has expired.
|
boolean |
isPersistent()
Returns
false if the cookie should be discarded at the end
of the "session"; true otherwise. |
boolean |
isSecure()
Indicates whether this cookie requires a secure connection.
|
String getName()
String getValue()
@Obsolete String getComment()
null if no such comment has been defined.@Obsolete String getCommentURL()
Date getExpiryDate()
Date of the cookie, or null
if none exists.
Note: the object returned by this method is considered immutable. Changing it (e.g. using setTime()) could result in undefined behaviour. Do so at your peril.
Date, or null.boolean isPersistent()
false if the cookie should be discarded at the end
of the "session"; true otherwise.false if the cookie should be discarded at the end
of the "session"; true otherwiseString getDomain()
String getPath()
@Obsolete int[] getPorts()
boolean isSecure()
true if this cookie should only be sent
over secure connections, false otherwise.@Obsolete int getVersion()
boolean isExpired(Date date)
date - Current timetrue if the cookie has expired.Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.