Class TipyCookie
Access cookies the same way as any other tipy input/output objects
class MyController extends TipyController {
public function index() {
$value = $this->cookie->get('myVar1');
$this->cookie->set('myVar2', 'Hello World!');
}
}
Methods summary
public
|
#
__construct( )
Construct TipyCookie instance from $_COOKIE.
Construct TipyCookie instance from $_COOKIE.
|
public
mixed
|
#
get( string $key, mixed $defaultValue,… )
Get cookie variable by its name
Get cookie variable by its name
Parameters
Returns
mixed
|
public
mixed
|
#
set( string $key, mixed $value, integer $expireTime = 0 )
Set cookie variable. You may pass unix timestamp as optional argument to set cookie expire time.
Set cookie variable. You may pass unix timestamp as optional argument to set cookie expire time.
Parameters
Returns
mixed
|
public
array
|
#
getAll( )
Get all cookies as array
Returns
array
|