csrf regenrate in ajax post |
I have this code for post data using ajax:
Code: $("selector").select2({ if I enable token regenerate, my code work only for first post data. I not found best practice for fix csrf token regenerate in multiple ajax post. any one can help!?
Why not the filter to tell card to ignore the actual controller and do some checking in the controller by checking if the actual post I ajax request
Read this.
Codeigniter CSRF valid for only one time ajax request For CI 3 but should work in CI 4. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(05-16-2020, 03:14 AM)InsiteFX Wrote: Read this. I read it before, this is not clear way for add token in each ajax json response controller. i think codeigniter need to laravel solution like this
Maybe something like this, not tested.
Code: $(function($) { Not sure if the view would see the security lib from the controller. I'll play around with this later on. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |