Im using session through ->getDI and \Phalcon\DI::getDefault()->get('flash') way. But they seems to be different. Services.php:
$di->set('session', function() {
$session = new Phalcon\Session\Adapter\Files();
$session->start();
return $session;
});
nothing special.
var_dump (\Phalcon\DI::getDefault()->get('flash')->getMessages());
var_dump($this->flashSession->getMessages());
var_dump (\Phalcon\DI::getDefault()->get('flash') == $this->flashSession);
so far its null; null, true. Everything is ok.
$this->flashSession->message('key2', 'val2');
var_dump (\Phalcon\DI::getDefault()->get('flash')->getMessages());
var_dump($this->flashSession->getMessages());
but now, the first dump has the values, while the 2nd DOES NOT! It returns a null.