class Cookie (View source)

A set of static methods for manipulating cookies.

Properties

Methods

public static 
get_inst()

Fetch the current instance of the cookie backend

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

Set a cookie variable

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

Get the cookie value by name

public static 
array
get_all(bool $includeUnsent = true)

Get all the cookies

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

No description

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

No description

public static 
set_report_errors($reportErrors) deprecated

No description

public static 
report_errors() deprecated

No description

Details

static Cookie_Backend get_inst()

Fetch the current instance of the cookie backend

Return Value

Cookie_Backend

The cookie backend

static set(string $name, mixed $value, int $expiry = 90, string $path = null, string $domain = null, bool $secure = false, bool $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

bool $secure

See http://php.net/set_session

bool $httpOnly

See http://php.net/set_session

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

Get the cookie value by name

Parameters

string $name

The name of the cookie to get

bool $includeUnsent

Include cookies we've yet to send when fetching values

Return Value

string|null

The cookie value or null if unset

static array get_all(bool $includeUnsent = true)

Get all the cookies

Parameters

bool $includeUnsent

Include cookies we've yet to send

Return Value

array

All the cookies

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

deprecated

No description

Parameters

$name
$path
$domain

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

No description

Parameters

$name
$path
$domain
$secure
$httpOnly

static set_report_errors($reportErrors) deprecated

deprecated

No description

Parameters

$reportErrors

static report_errors() deprecated

deprecated

No description