-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial access to web-page leads to 403 #140
Comments
I suspect that the issue comes from a race condition between your XHR request (on page load?) and the csrf library trying to initialize. One quick way to find this out is to delay your POST request (using a timer of 1s to be sure). |
Thanks for your reply. Sry, if i didn't understood you well here. |
In this case, my assumption was wrong. I thought you would auto trigger a XHR post request when the DOM was loaded (which then might create an issue with csrf). But in your case you have the issue even when manually triggering the first POST via the login form (which is correct workflow wise). So no delay will help here, sorry. The issue is not related and must be something else. |
please how to do that |
I don't if it is a bug in my client code or this behaviour is by design.
When I call my page in a "fresh" browser (all browser data and cache cleared before), I get on my first XHR (POST)
this msg of hell: "OWASP CSRF PROTECTOR VALIDATION FAILURE"
which leads to a 403 in the end.
The next XHR's then work I can observe that CSRF_TOKEN Cookie is set.
The strange thing is, that even for that , I had to change this lines in "csrfprotector.php":
(moving self::authorizePost(); to the bottom)
I using the V.1.0.0. but in the end, V1.0.2 it's the same.
I really don't know where my problem is.
Sorry, if might be wrong here.
The text was updated successfully, but these errors were encountered: