The Phalcon version is 2.0.8
I set the session service in the public index.php file :
use Phalcon\Session\Adapter\Files as SessionFiles; try { ... $di = new FactoryDefault();
// Start the session the first time when some component request the session service
$di->setShared('session', function () {
$session = new SessionFiles();
$session->start();
return $session;
});
....
}
When I set a Phalcon session variable then I cannot get the equivalent $_SESSION PHP variable unless I write this code :
$di = \Phalcon\DI::getDefault(); $session = $di->getSession();
So Why should I call this code to synchronize Phalcon sessions and PHP sessions ?