Top Description Methods
org.apache.http.cookie

public Interface SetCookie

extends Cookie
Known Direct Subinterfaces
org.apache.http.cookie.SetCookie2
Known Direct Implementers
org.apache.http.impl.cookie.BasicClientCookie
Imports
java.util.Date, org.apache.http.annotation.Obsolete

This interface represents a 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

Since
4.0

Method Summary

Modifier and TypeMethod and Description
public 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.

public void
setDomain(String
The value of the domain attribute
domain
)

Sets the domain attribute.

public void
setExpiryDate(Date
the Date after which this cookie is no longer valid.
expiryDate
)

Sets expiration date.

public void
setPath(String
The value of the path attribute
path
)

Sets the path attribute.

public void
setSecure(boolean
The value of the secure attribute
secure
)

Sets the secure attribute of the cookie.

public void
public void
setVersion(int
the version of the cookie.
version
)

Sets the version of the cookie specification to which this cookie conforms.

Inherited from org.apache.http.cookie.Cookie:
getCommentgetCommentURLgetDomaingetExpiryDategetNamegetPathgetPortsgetValuegetVersionisExpiredisPersistentisSecure

Method Detail

setCommentback to summary
public 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.

Annotations
@Obsolete
See Also
getComment()
setDomainback to summary
public void setDomain(String domain)

Sets the domain attribute.

Parameters
domain:String

The value of the domain attribute

See Also
Cookie#getDomain
setExpiryDateback to summary
public void setExpiryDate(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:Date

the Date after which this cookie is no longer valid.

See Also
Cookie#getExpiryDate
setPathback to summary
public void setPath(String path)

Sets the path attribute.

Parameters
path:String

The value of the path attribute

See Also
Cookie#getPath
setSecureback to summary
public 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:boolean

The value of the secure attribute

See Also
isSecure()
setValueback to summary
public void setValue(String value)
setVersionback to summary
public void setVersion(int version)

Sets the version of the cookie specification to which this cookie conforms.

Parameters
version:int

the version of the cookie.

Annotations
@Obsolete
See Also
Cookie#getVersion