Skip to main content
Version: Fegg 5.x

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​

NameData typeDefaultRemarks
$namestringSession key
$valuemixedValue

Example​

Controller
$this->setSession('foo', 'bar');
$this->setSession('cart', array('item_id' => 3, 'quantity' => 1));