01-20-2017, 04:35 PM
That usually means you have some sort of redirect or are doing something fancy in the middle of your form. Are you using any ajax or javascript?
Every time the page is loaded, you generate a token in the form...
Then on submission, you get
Because a new token is generated every time the page is loaded, if the one the system has is not the one the user has, then something is reloading the form mid stream. For testing purposes, you can comment out the die statement but it is a good idea to figure out why your page is reloading....
One other thing, you could possibly be calling on the page twice or something weird like that. Is that happening?
Every time the page is loaded, you generate a token in the form...
Code:
<input type="hidden" name="csrf" value="<?=Token::generate();?>" >
Then on submission, you get
Code:
$token = Input::get('csrf');
Code:
if(!Token::check($token)){
Code:
die('Token doesn\'t match!');
Code:
}
Because a new token is generated every time the page is loaded, if the one the system has is not the one the user has, then something is reloading the form mid stream. For testing purposes, you can comment out the die statement but it is a good idea to figure out why your page is reloading....
One other thing, you could possibly be calling
Code:
<?=Token::generate();?>