CSRF-Protector-PHP icon indicating copy to clipboard operation
CSRF-Protector-PHP copied to clipboard

Issue with Ajax POST calls on page loads

Open bhavinrshah opened this issue 5 years ago • 10 comments

JS Request:

Request Header:

CSRF Error

Please check.

bhavinrshah avatar May 16 '19 15:05 bhavinrshah

@mebjas : Can you please look into this?

bhavinrshah avatar May 17 '19 07:05 bhavinrshah

@bhavinrshah on it

mebjas avatar May 22 '19 03:05 mebjas

So it looks to be related to this - https://github.com/mebjas/CSRF-Protector-PHP/pull/112

As a temp hack you could try making changes as suggested in this PR.

mebjas avatar May 22 '19 10:05 mebjas

I tried but that is not working. I have to replace $(document).ready(function() { to $(window).bind('load', function() { and it works. But still if it can be done through csrfprotector.js that would be great.

bhavinrshah avatar May 22 '19 14:05 bhavinrshah

Yes please make the required changes as dont in that PR in CSRF Protector code. Can you have the projec ton github? I'll send a PR to the same to test this scenario further.

@bhavinrshah

mebjas avatar May 23 '19 12:05 mebjas

@mebjas : Let me create a test project on github and let you know

bhavinrshah avatar May 28 '19 15:05 bhavinrshah

@mebjas : Here is link https://github.com/bhavinrshah/csrf_issue

bhavinrshah avatar May 29 '19 08:05 bhavinrshah

@bhavinrshah will setup the stack and check. Stay tuned.

mebjas avatar May 29 '19 15:05 mebjas

@mebjas: Do we have any update on this?

bhavinrshah avatar Jun 04 '19 06:06 bhavinrshah

There is a missing submit.php file to completely reproduce this demo. Can you add some mock submit.php so I can test end to end? @bhavinrshah

mebjas avatar Jul 21 '19 10:07 mebjas