Cookie

Represents an HTTP Cookie.

All cookies must have a name and a value and can optionally have other fields set such as path, domain, etc.

(Derived from io.netty.handler.codec.http.Cookie)

package

Default

Methods

__construct

__construct() 

Encode the cookie to a string. This is what is used in the Set-Cookie header

encode() : string

Response

string

the encoded cookie

getDomain

getDomain() : string

Response

string

the domain for the cookie

getName

getName() : string

Response

string

the name of this cookie

getPath

getPath() : string

Response

string

the path for this cookie

getValue

getValue() : string

Response

string

the value of this cookie

Has the cookie been changed? Changed cookies will be saved out in the response and sent to the browser.

isChanged() : boolean

Response

boolean

true if changed

Has this Cookie been sent from the User Agent (the browser)? or was created during the executing on the request.

isFromUserAgent() : boolean

Response

boolean

true if the cookie comes from the User Agent.

Set the cookie as being changed. Changed will be true for a cookie just created, false by default if just read from the request

setChanged( $arg0) : void

Arguments

$arg0

boolean

Sets the domain of this cookie

setDomain( $arg0) : $this

Arguments

$arg0

string

Response

$this

a reference to this, so the API can be used fluently

Determines if this cookie is HTTP only.

setHttpOnly( $arg0) : $this

If set to true, this cookie cannot be accessed by a client side script. However, this works only if the browser supports it. For for information, please look here.

Arguments

$arg0

boolean

Response

$this

Sets the maximum age of this cookie in seconds.

setMaxAge( $arg0) : $this

If an age of 0 is specified, this cookie will be automatically removed by browser because it will expire immediately. If \java.lang.Long is specified, this cookie will be removed when the browser is closed. If you don't set this the cookie will be a session cookie and be removed when the browser is closed.

Arguments

$arg0

integer

Response

$this

Sets the path of this cookie.

setPath( $arg0) : $this

Arguments

$arg0

string

Response

$this

a reference to this, so the API can be used fluently

Sets the security getStatus of this cookie

setSecure( $arg0) : $this

Arguments

$arg0

boolean

Response

$this

a reference to this, so the API can be used fluently

Sets the value of this cookie

setValue( $arg0) : $this

Arguments

$arg0

string

Response

$this

a reference to this, so the API can be used fluently