interface CookieInterface (View source)

Object cookie interface

Constants

COOKIE_MAX_SIZE

Methods

setName(string $name)

Set cookie name

string
getName()

Get cookie name

setValue(string $value, bool $serialize)

Set value of cookie

string
getValue(bool $unserialize)

Get cookie value

setExpire(integer $time)

Set cookie's expiration time

setPath(string $location)

Set cookie's path

setDomain(string $domain)

Set cookie's domain

setSecure(bool $mode)

Set if the cookie should be transmitted only via https

setHttponly($mode)

Set if cookie should be available only to HTTP protocol

boolean
save()

Set cookie

load()

Get cookie

bool
delete()

Delete cookie

bool
exists()

Check if cookie exists

Details

CookieInterface setName(string $name)

Set cookie name

Parameters

string $name The cookie name.

Return Value

CookieInterface The invoked object.

Exceptions

CookieException

string getName()

Get cookie name

Return Value

string Name of cookie

CookieInterface setValue(string $value, bool $serialize)

Set value of cookie

Parameters

string $value The value of cookie.
bool $serialize If true, cookie will be serialized (default)

Return Value

CookieInterface The invoked object.

Exceptions

CookieException

string getValue(bool $unserialize)

Get cookie value

Parameters

bool $unserialize If true, cookie will be unserialized (default)

Return Value

string Value of cookie

CookieInterface setExpire(integer $time)

Set cookie's expiration time

Parameters

integer $time

Return Value

CookieInterface The invoked object.

Exceptions

CookieException

CookieInterface setPath(string $location)

Set cookie's path

Parameters

string $location

Return Value

CookieInterface The invoked object.

Exceptions

CookieException

CookieInterface setDomain(string $domain)

Set cookie's domain

Parameters

string $domain

Return Value

CookieInterface The invoked object.

Exceptions

CookieException

CookieInterface setSecure(bool $mode)

Set if the cookie should be transmitted only via https

Parameters

bool $mode

Return Value

CookieInterface The invoked object.

CookieInterface setHttponly($mode)

Set if cookie should be available only to HTTP protocol

Parameters

$mode

Return Value

CookieInterface The invoked object.

boolean save()

Set cookie

Return Value

boolean

CookieInterface load()

Get cookie

Return Value

CookieInterface The invoked object.

bool delete()

Delete cookie

Return Value

bool

bool exists()

Check if cookie exists

Return Value

bool