banujan6/CSRF-handler

Ajax request

onebeat opened this issue · 2 comments

Hello, how can i implement this CSFR-handler inside ajax requst ?

Currently i have MVC framework when load VIEW it generates token and when i want to edit it is working fine (first time because CSFR tokens are the same) but next time without refresh i get error - i understand where is the problem so if you can help ?

Thank you in advance...

Hi @onebeat ,

In current version, The token will be expired after the request. Which means, You have to use 1 token / request.

The solution I suggest you for now is, End of your AJAX request, return a new token in response. Then you can overwrite the current token with the new token you get.

NOTE

If you are developing Rest API or cookieless application, Then no need to integrate CSRF.

Thanks!

Hello, as soon i have posted question- done same thing like you wrote. basicly when explaining you my problem i found solution.

Thank you anyway, your CSFR-handler is AMAZING 👍