I’m using DooPHP and I’m generating a security token for my form to protect against csrf attacks. I’m assigning the token to a smarty variable and I can see that it is displayed in the source – so it is available. When I submit the form though, it throws out an error saying:
Undefined variable: secToken
See file C:\wamp\www\korysdoo\protected\class\smarty\sysplugins\smarty_internal_data.php
Error on line 291 $x = $$_variable;
Any ideas what can be wrong? I can see that the value of secToken is being posted to an appropriate function.
Problem solved. Though it was lying somewhere else. When the login was unsuccessful (which it was, for different reasons), I was displaying the same login form template without assigning the security token again.