CodeIgniter Forums
How to reset CRSF on refresh page ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: How to reset CRSF on refresh page ? (/showthread.php?tid=65528)



How to reset CRSF on refresh page ? - ryantranvn - 06-22-2016

In CodeIgniter 3 have function "Regenerate token on every submission" so cool. But, if i want to create a function "Regenerate token on every REFRESH PAGE". How can i do that ? Blush Thanks all!


RE: How to reset CRSF on refresh page ? - PaulD - 06-22-2016

If you have set regeneration to true, then every post request will regenerate the token. Pressing refresh is not a post so will not regenerate the token. There is no way of doing a 'force refresh' that I know of and I am not sure why you would want to. If you are not posting anything there is no need to refresh the token, as without a post you will not be susceptible to CSRF.

Hope that helps,

Paul.


RE: How to reset CRSF on refresh page ? - ryantranvn - 06-23-2016

Wow...thanks PaulD so much!