In my view I have
<input type="hidden" name="<?php echo $this->security->getTokenKey() ?>" value="<?php echo $this->security->getToken() ?>"/>
in my controller I have
echo "<pre>";
print_r(var_dump($this->security->checkToken()));
echo "</pre>";
exit;
which returns false.
Now i added this in my apache config
RedirectMatch 204 /robots.txt
RedirectMatch 204 /favicon.ico
and in my debugger, for favicon it says 204.
if inside the view i print my session I get
Array
(
[$PHALCON/CSRF$] => MDmkpUWC6qN5KAtt
[$PHALCON/CSRF/KEY$] => Aw821s5pNwq6IPsG
)
and if I inspect the hidden element, those are the name and the value of the input. However once I click "submit" , inside the controller if I print the Session again, I get complatyly different values
Multi module app
in my application.php file I have
use \Phalcon\Session\Adapter\Files as SessionAdapter;
$this->di->set('session', function () {
$session = new SessionAdapter();
$session->start();
return $session;
}, true);
Phalcon 2.1.x