class Cookie

A set of static methods for manipulating cookies.

Config options

report_errors boolean

Methods

static Cookie_Backend
get_inst()

Fetch the current instance of the cookie backend

static 
set(string $name, mixed $value, int $expiry = 90, string $path = null, string $domain = null, boolean $secure = false, boolean $httpOnly = true)

Set a cookie variable

static string|null
get(string $name, boolean $includeUnsent = true)

Get the cookie value by name

static array
get_all(boolean $includeUnsent = true)

Get all the cookies

static 
forceExpiry($name, $path = null, $domain = null) deprecated

No description

static 
force_expiry($name, $path = null, $domain = null, $secure = false, $httpOnly = true)

No description

static 
set_report_errors($reportErrors) deprecated

No description

static 
report_errors() deprecated

No description

Details

at line 21
static Cookie_Backend get_inst()

Fetch the current instance of the cookie backend

Return Value

Cookie_Backend The cookie backend

at line 36
static set(string $name, mixed $value, int $expiry = 90, string $path = null, string $domain = null, boolean $secure = false, boolean $httpOnly = true)

Set a cookie variable

Parameters

string $name The variable name
mixed $value The variable value.
int $expiry The expiry time, in days. Defaults to 90.
string $path See http://php.net/set_session
string $domain See http://php.net/set_session
boolean $secure See http://php.net/set_session
boolean $httpOnly See http://php.net/set_session

at line 50
static string|null get(string $name, boolean $includeUnsent = true)

Get the cookie value by name

Parameters

string $name The name of the cookie to get
boolean $includeUnsent Include cookies we've yet to send when fetching values

Return Value

string|null The cookie value or null if unset

at line 60
static array get_all(boolean $includeUnsent = true)

Get all the cookies

Parameters

boolean $includeUnsent Include cookies we've yet to send

Return Value

array All the cookies

at line 67
static forceExpiry($name, $path = null, $domain = null) deprecated

deprecated

Parameters

$name
$path
$domain

at line 78
static force_expiry($name, $path = null, $domain = null, $secure = false, $httpOnly = true)

Parameters

$name
$path
$domain
$secure
$httpOnly

at line 85
static set_report_errors($reportErrors) deprecated

deprecated

Parameters

$reportErrors

at line 93
static report_errors() deprecated

deprecated