Ajax request and regenerate csrf |
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 ?
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.
(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? |
Welcome Guest, Not a member yet? Register Sign In |