(Yaf >=1.0.0)
Yaf_Session::set — Set a session value
Sets a session value.
nameThe session key to set.
valueThe value to store.
Example #1 Yaf_Session::set() example
<?php
class LoginController extends Yaf_Controller_Abstract
{
public function indexAction()
{
// ... verify the credentials against the database
$session = Yaf_Session::getInstance();
$session->start();
$session->set("user_id", $user->getId());
$session->set("login_time", time());
return $this->redirect("/dashboard");
}
}
?>