1

98% of our users are able to login fine. But I'm seeing a small segment of users who are seeing InvalidStateException. My site sits behind an HAProxy load balancer. I'm not sure what could be impacting this causing the invalid state. I haven't seen any consistency with the user's device, browser or anything else.

With most of my users not having any issues, what should I look at to try to resolve this issue?

enter image description here

Ben
  • 60,438
  • 111
  • 314
  • 488
  • https://stackoverflow.com/questions/30660847/laravel-socialite-invalidstateexception – Alexey Mezenin Jan 18 '18 at 20:08
  • 1
    I have reviewed that SO post and have not found a solution trying what others have posted. `stateless()` is not an option because I need to use the token that comes out of this so I can get more information about the user. – Ben Jan 18 '18 at 20:11
  • `state` is used to determine that requests are valid, specifically, you set `state` in the session and then the provider returns it as part of the request URL, which is then compared. If `state` in the session and `state` in the URL don't match, an error is thrown, you can see that here: https://github.com/laravel/socialite/blob/647ee1b1b7520e16c661b4df5cdff1d7f6902eee/src/Two/AbstractProvider.php#L236 To debug this I would first start by looking at some of the requests that triggered this: check the URL that they were visiting and then check their session data to compare the `state` values – sam Jan 18 '18 at 20:36
  • Does this happen to certain user's only or is it random to whom and when it occurs? –  Jan 18 '18 at 22:28
  • @btl - When it happens, it'll be a single user who tries 3-4 times and continues to get the error each time. – Ben Jan 19 '18 at 15:30

0 Answers0