Skip to content
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

Getting error "Session does not contain antiforgery ID" #262

Closed
admin-eschaeffer58 opened this issue Feb 19, 2023 · 5 comments
Closed

Getting error "Session does not contain antiforgery ID" #262

admin-eschaeffer58 opened this issue Feb 19, 2023 · 5 comments

Comments

@admin-eschaeffer58
Copy link

We have been using this plugin for years and at some point in the last week, we started to get the ANTI_FORGERY error where there was no ID present. I tried completely deleting the plugin and reinstalling it with no change.

We have another "stage" instance that is on the same version of WP and the plugin that is not seeing the issue. Both Prod and stage instances are connected to the same azure AD via different registered apps with the exact same settings (other that client id/secret). It's driving me mad and now our org can't login at all. I have seen several bugs open on this with no resolution.

@admin-eschaeffer58
Copy link
Author

admin-eschaeffer58 commented Feb 19, 2023

I found in the code where the error was coming from and put a print_r($_SESSION) in the conditional, that triggers the error and it appears that no session data is being returned. I get an empty array output.

Array ( )

@admin-eschaeffer58
Copy link
Author

Ok, so ended up figuring the issue out. Turns out the session path for the php instance on this cpanel server was invalid. Once I set a valid path, it fixed the issue.

@psignoret
Copy link
Owner

Thanks for reporting, and thanks for following up with the issue on your side and how you solved it. Indeed, this issue is always something to do with sessions, but the root cause is rarely the same, and is usually dependent on the infrastructure WordPress is installed on.

I'll use the information you shared to improve the troubleshooting options available, and try to see if there isn't a better way to achieve the same capability without relying on PHP sessions.

@bradkovach
Copy link
Contributor

bradkovach commented Feb 20, 2023 via email

@psignoret
Copy link
Owner

Yeah, I was thinking of testing PHP sessions at config time (show warnings and allow saving but not enabling) and at runtime (show useful error instead of redirecting to a sign-in which is guaranteed to fail).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants