Application::getCookie
Get COOKIE data
Description
public void Application::getCookie( [ string $name = "" ] )
Get COOKIE data. If you omit argument, getCookie
return all COOKIE data.
Arguments
Name | Data type | Default | Remarks |
---|---|---|---|
$name | string | Cookie param key |
Example
Controller - First.php
$this->setCookie('foo', 'bar');
Controller - Second.php
$this->getCookie('foo'); // -> bar
Get all cookie datas
If you omit argument, getCookie
return all COOKIE data.
Controller - First.php
$this->setCookie('foo', 'bar');
$this->setCookie('baz', 'qux');
Controller - Second.php
var_dump( $this->getCookie() );
Output
array(2) { ["foo"]=> string(3) "bar" ["baz"]=> string(3) "qux" }