Am setting up a session in a controller function using the following;
$di->setShared('session', function() {
$session = new Phalcon\Session\Adapter\Files();
$session->start();
return $session;
});
but when I run var_dump($session->getId());exit; within the functionI get the following errors;
1.Notice: Undefined variable: di in
2.Fatal error: Call to a member function setShared() on a non-object in
My objective is to start a session with will be active in the whole application.
Thanks for the help