php version 7.1.4
phalcon version 3.1.2
controller file :
namespace Application\Controller;
use Phalcon\Mvc\Controller;
class TestController extends Controller{
public function indexAction(){
$this->session->set("user-name", "Michael");
var_dump($this->session->get('user-name'));
}
public function aAction(){
$a = $this->session->has("user-name")
$b = $this->session->get("user-name");
var_dump($a, $b);
}
}
index.php(Entry file):
$di->set('session', function(){
$session = new SessionFile();
$session->start();
return $session;
}, true);
access ‘/Test/index’:
string(7) "Michael"
access '/Test/a':
bool(false)
NULL
why?