Application::setSession
Set SESSION data (and start the session)
Description
public void Application::setSession( string $name, mixed $value )
Set SESSION data. Starts the session if it has not been started, so you never call session_start() yourself (see SESSION).
Arguments
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $name | string | Session key | |
| $value | mixed | Value |
Example
Controller
$this->setSession('foo', 'bar');
$this->setSession('cart', array('item_id' => 3, 'quantity' => 1));