Hello,
I'm currently trying to migrate one of my sites to v4.
Unfortunately my CSRF validations don't work anymore ; it seems like there's a configuration issue somewhere.
These are my current security + session providers :
$di->set('security', function() use ($di) {
$security = new \Phalcon\Security();
$security->setDI($di);
// Set the password hashing factor to 12 rounds
$security->setWorkFactor(12);
return $security;
}, true);
$di->set('session', function() {
$session = new \Phalcon\Session\Manager();
$files = new \Phalcon\Session\Adapter\Stream([
'savePath' => '/tmp',
]);
$session
->setAdapter($files)
->start();
return $session;
});
The session is created, but for some reason I can't get the security tokens to work :
var_dump($this->session->exists()); // true
var_dump($this->security->getToken()); // NULL
I'm not sure what I'm missing. It was working perfectly on v3, I only renamed the classes as per the upgrade guide : https://docs.phalcon.io/4.0/en/upgrade
Any advice ?
Thanks !