Package org.apache.http.cookie
Interface SetCookie
-
- All Superinterfaces:
Cookie
- All Known Subinterfaces:
SetCookie2
- All Known Implementing Classes:
BasicClientCookie
,BasicClientCookie2
public interface SetCookie extends Cookie
This interface represents aSet-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
- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
setComment(java.lang.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(java.lang.String domain)
Sets the domain attribute.void
setExpiryDate(java.util.Date expiryDate)
Sets expiration date.void
setPath(java.lang.String path)
Sets the path attribute.void
setSecure(boolean secure)
Sets the secure attribute of the cookie.void
setValue(java.lang.String value)
void
setVersion(int version)
Sets the version of the cookie specification to which this cookie conforms.-
Methods inherited from interface org.apache.http.cookie.Cookie
getComment, getCommentURL, getDomain, getExpiryDate, getName, getPath, getPorts, getValue, getVersion, isExpired, isPersistent, isSecure
-
-
-
-
Method Detail
-
setValue
void setValue(java.lang.String value)
-
setComment
@Obsolete void setComment(java.lang.String comment)
If a user agent (web browser) presents this cookie to a user, the cookie's purpose will be described using this comment.- Parameters:
comment
-- See Also:
Cookie.getComment()
-
setExpiryDate
void setExpiryDate(java.util.Date expiryDate)
Sets expiration date.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.
- Parameters:
expiryDate
- theDate
after which this cookie is no longer valid.- See Also:
Cookie.getExpiryDate()
-
setDomain
void setDomain(java.lang.String domain)
Sets the domain attribute.- Parameters:
domain
- The value of the domain attribute- See Also:
Cookie.getDomain()
-
setPath
void setPath(java.lang.String path)
Sets the path attribute.- Parameters:
path
- The value of the path attribute- See Also:
Cookie.getPath()
-
setSecure
void setSecure(boolean secure)
Sets the secure attribute of the cookie.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.- Parameters:
secure
- The value of the secure attribute- See Also:
Cookie.isSecure()
-
setVersion
@Obsolete void setVersion(int version)
Sets the version of the cookie specification to which this cookie conforms.- Parameters:
version
- the version of the cookie.- See Also:
Cookie.getVersion()
-
-