![]() |
Ajax request and regenerate csrf - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Ajax request and regenerate csrf (/showthread.php?tid=68539) |
Ajax request and regenerate csrf - pippuccio76 - 07-23-2017 hi , sorry for english , i must get some value from a db to populate a select . this is my js code : Code: <script> this is the controller : Code: function get_province(){ If i have only one call it work otherwise i have error 403 . I can solve it by set $config['csrf_regenerate'] to FALSE but is it secure ? RE: Ajax request and regenerate csrf - spjonez - 07-24-2017 If you don't need to support concurrent requests pass the new CSRF token back from CI and into your success callback and set it to a variable in JavaScript. Pass the value of your JS variable on each request. If you do require concurrent requests set regenerate to false. Another option is to use a queue to ensure only a single request fires at any given time. RE: Ajax request and regenerate csrf - pippuccio76 - 07-24-2017 (07-24-2017, 10:19 AM)spjonez Wrote: If you don't need to support concurrent requests pass the new CSRF token back from CI and into your success callback and set it to a variable in JavaScript. Pass the value of your JS variable on each request. This is a registration form , i must populate 3 select , the first populate the second and the second the tird . can i set regenerate to false ? But if i set false is false for every part of site? Is it secure? |