Hi, i want set global csrf value.
// baseConstroller
$data['csrf'] = [
'name' => $this->security->getTokenKey(),
'value' => $this->security->getToken()
];
<!-- form -->
<input type="hidden" name="{{ $csrf['name'] }}" value="{{ $csrf['value'] }}">
// authController
$this->security->checkToken() // false
but, is it not working. Even when POST is requested, the value has changed and cannot be checked.
I write session in service.
$di->setShared('session', function () {
$session = new SessionManager();
$files = new SessionAdapter([
'savePath' => sys_get_temp_dir(),
]);
$session->setAdapter($files);
$session->start();
return $session;
});
Anyone know this?