How to correctly use crsf?
$csrf = new Hidden('csrf',
array(
'name' => $this->security->getTokenKey(),
'value' => $this->security->getToken(),
));
$csrf->addValidator(
new Identical(array(
'value' => $this->security->getSessionToken(),
'message' => 'CSRF validation failed'
))
);
$this->add($csrf);
OR
$csrf = new Hidden('csrf',
array(
'value' => $this->security->getSessionToken(),
));
$csrf->addValidator(
new Identical(array(
'value' => $this->security->getSessionToken(),
'message' => 'CSRF validation failed'
))
);
$this->add($csrf);