Skip to main content

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

NameData typeDefaultRemarks
$namestringCookie param key

Example

Controller - First.php
$this->setCookie('foo', 'bar');
Controller - Second.php
$this->getCookie('foo'); // -> bar

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" }