first opend page validation will failed if open another page before submit first
if I opened two pages both have CSRF protection, the first page's validation will failed
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
<input type="hidden" name="<?php echo $this->security->getTokenKey() ?>"
value="<?php echo $this->security->getToken() ?>"/>
Hi,
I'll was going to make a post about this but since it exists I'll comment here.
I also have noticed that the CSRF Protection does not support multiple tabs since it only saves one token and one key on session.
The Phalcon\Security class stores the names which use to store keys and tokens on session as protected properties, but does not define a set and get method for those properties here and there.
Ugly solution: Extend Phalcon\Security class to add a set and get method for them and create an array of the extended class instances, then add one each time you create a token and remove it each time a token is validated and workaround it like that, but it's really annoying...
Nice solution: It would be easier to add a multiple tokens support directly on that class storing an array of keys and tokens, create and destroy them as they are requested and used. There also has to be a "limit" of how many tokens are saved or "expire them" to avoid infinite values to be stored; maybe both of them.
I think web applications are mature enough to be expected of supporting multiple tabs and CSRF protection.
Regards, Federico.
Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues