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