ResponseCookie

Class to represent an HTTP response cookie

package Klein

 Methods

Constructor

__construct(string $name, string $value, int $expire, string $path, string $domain, boolean $secure, boolean $http_only) 
access public

Parameters

$name

string

The name of the cookie

$value

string

The value to set the cookie with

$expire

int

The time that the cookie should expire

$path

string

The path of which to restrict the cookie

$domain

string

The domain of which to restrict the cookie

$secure

boolean

Flag of whether the cookie should only be sent over a HTTPS connection

$http_only

boolean

Flag of whether the cookie should only be accessible over the HTTP protocol

Gets the cookie's domain

getDomain() : string
access public

Returns

string

Gets the cookie's expire time

getExpire() : int
access public

Returns

int

Gets the cookie's HTTP only flag

getHttpOnly() : boolean
access public

Returns

boolean

Gets the cookie's name

getName() : string
access public

Returns

string

Gets the cookie's path

getPath() : string
access public

Returns

string

Gets the cookie's secure only flag

getSecure() : boolean
access public

Returns

boolean

Gets the cookie's value

getValue() : string
access public

Returns

string

Sets the cookie's domain

setDomain(string $domain) : \Klein\ResponseCookie
access public

Parameters

$domain

string

Returns

Sets the cookie's expire time

setExpire(int $expire) : \Klein\ResponseCookie

The time should be an integer representing a Unix timestamp

access public

Parameters

$expire

int

Returns

Sets the cookie's HTTP only flag

setHttpOnly(boolean $http_only) : \Klein\ResponseCookie
access public

Parameters

$http_only

boolean

Returns

Sets the cookie's name

setName(string $name) : \Klein\ResponseCookie
access public

Parameters

$name

string

Returns

Sets the cookie's path

setPath(string $path) : \Klein\ResponseCookie
access public

Parameters

$path

string

Returns

Sets the cookie's secure only flag

setSecure(boolean $secure) : \Klein\ResponseCookie
access public

Parameters

$secure

boolean

Returns

Sets the cookie's value

setValue(string $value) : \Klein\ResponseCookie
access public

Parameters

$value

string

Returns

 Properties

 

$domain : string
access protected
 

$expire : int

Represented by a Unix "Timestamp"

access protected
 

$http_only : boolean
access protected
 

$name : string
access protected
 

$path : string
access protected
 

$secure : boolean
access protected
 

$value : string
access protected