hi all,
i have two form on same page (login and signup ), via forms i created two csrf object but when only loginform is working , its working but when two , csrf is invalid i got.
how can i solve it ?
LoginForm.php
// CSRF
$csrf = new Hidden('csrf');
$csrf->addValidator(new Identical(array(
'value' => $this->security->getSessionToken(),
'message' => 'CSRF Doğrulaması Hatalı'
)));
$this->add($csrf);
Signupform.php
$csrf = new Hidden('csrfa');
$csrf->addValidator(new Identical(array(
'value' => $this->security->getSessionToken(),
'message' => 'CSRF validation failed'
)));
$this->add($csrf);
on main.phtml
on login form: <?php echo $login_form->render('csrf',array('value' => $this->security->getToken()));?> on signup form : <?php echo $signup_form->render('csrfa',array('value' => $this->security->getToken()));?>
how can i solve it ? Thanks for all