I am using exact code as it is from here: https://ellislab.com/codeigniter/user-guide/libraries/form_validation.html
It all works great when csrf_protection in config file is set on false. But when I set it on true, and submit a form, I get an error:
An Error Was Encountered
The action you have requested is not allowed.
I tried to run code on Chrome 39 and on IE 8. It works on both. But on Firefox 34 it doesn't.
So apparently something is wrong with firefox 34? I googled about it but i didn't find anything.
Then I ran some more tests on what is happening with csrf_hash. I put log_message('info', $this->security->get_csrf_hash());
in controller. And i found out that when i refresh (run) controller in Chrome and IE, csrf_hash does not change, it is changed just when i submit form and post is sent back to controller. In firefox csrf_hash is changed every time when controller runs.
In Log file, when i submit my form in fireofx, the last log is
[DEBUG - 2014-12-10 12:45:50 --> Input Class Initialized]
,
next one would have to be
[DEBUG - 2014-12-10 12:45:50 --> CRSF cookie Set]
but it never came to that. So I suppose that on form submition in firefox, crsf cookie don't want to be set. Why in firefox but not in IE and Chrome?
I am new with codeigniter, and I am working on that problem for 3rd day now =(.
I would appreciate any help or hint with this. Thanks!