I have problem with security token

I have this in HTML

<input type="hidden" name="<?php echo $this->security->getTokenKey(); ?>" value="<?php echo $this->security->getToken(); ?>"/>

and this in PHP

if ($this->security->checkToken()):

then when I click again to see if it works the token it says the token does not work

why? help me



2.2k

What do you mean with "then when I click again to see if it works..."? Each token is only valid for one request. If you fired the request and try to reload the Page with F5, the token will be invalid.

Thats the main reason for the Security Token. It prevents your forms to be fired from anywhere. It only allows the form to be fired from within your application and each request only one time.