class Cookie (View source)

A set of static methods for manipulating cookies.

Traits

Provides extensions to this object to integrate it with standard config API methods.

Properties

static private bool $report_errors

Methods

static Config_ForClass
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

mixed
stat(string $name) deprecated

Get inherited config value

mixed
uninherited(string $name)

Gets the uninherited value for the given config option

$this
set_stat(string $name, mixed $value) deprecated

Update the config value for a given property

static Cookie_Backend
get_inst()

Fetch the current instance of the cookie backend.

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

Set a cookie variable.

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

Get the cookie value by name. Returns null if not set.

static array
get_all(bool $includeUnsent = true)

Get all the cookies.

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

No description

Details

static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

Return Value

Config_ForClass

mixed stat(string $name) deprecated

deprecated 5.0 Use ->config()->get() instead

Get inherited config value

Parameters

string $name

Return Value

mixed

mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

$this set_stat(string $name, mixed $value) deprecated

deprecated 5.0 Use ->config()->set() instead

Update the config value for a given property

Parameters

string $name
mixed $value

Return Value

$this

static Cookie_Backend get_inst()

Fetch the current instance of the cookie backend.

Return Value

Cookie_Backend

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

Set a cookie variable.

Expiry time is set in days, and defaults to 90.

Parameters

string $name
mixed $value
float $expiry
string $path
string $domain
bool $secure
bool $httpOnly

See http://php.net/set_session

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

Get the cookie value by name. Returns null if not set.

Parameters

string $name
bool $includeUnsent

Return Value

null|string

static array get_all(bool $includeUnsent = true)

Get all the cookies.

Parameters

bool $includeUnsent

Return Value

array

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

Parameters

string $name
null|string $path
null|string $domain
bool $secure
bool $httpOnly