public interface SetCookie extends Cookie
Set-Cookie
response header sent by the
origin server to the HTTP agent in order to maintain a conversational state.
Please do not use methods marked as @Obsolete. They have been rendered obsolete by RFC 6265
Modifier and Type | Method and Description |
---|---|
void |
setComment(String comment)
If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described using this comment.
|
void |
setDomain(String domain)
Sets the domain attribute.
|
void |
setExpiryDate(Date expiryDate)
Sets expiration date.
|
void |
setPath(String path)
Sets the path attribute.
|
void |
setSecure(boolean secure)
Sets the secure attribute of the cookie.
|
void |
setValue(String value) |
void |
setVersion(int version)
Sets the version of the cookie specification to which this
cookie conforms.
|
getComment, getCommentURL, getDomain, getExpiryDate, getName, getPath, getPorts, getValue, getVersion, isExpired, isPersistent, isSecure
void setValue(String value)
@Obsolete void setComment(String comment)
comment
- Cookie.getComment()
void setExpiryDate(Date expiryDate)
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.
expiryDate
- the Date
after which this cookie is no longer valid.Cookie.getExpiryDate()
void setDomain(String domain)
domain
- The value of the domain attributeCookie.getDomain()
void setPath(String path)
path
- The value of the path attributeCookie.getPath()
void setSecure(boolean secure)
When true
the cookie should only be sent
using a secure protocol (https). This should only be set when
the cookie's originating server used a secure protocol to set the
cookie's value.
secure
- The value of the secure attributeCookie.isSecure()
@Obsolete void setVersion(int version)
version
- the version of the cookie.Cookie.getVersion()
Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.