Github/php & Facebook/php both seem to be giving me"invalid state"

i am asking this question again, since a bit of further research is actually showing a different error.

when i use the example script below, i am indeed able to log in very successfully using both Auth0 and Google.

however, when i attempt to log in with either Facebook or Github, i get the following error:

$userInfo = $auth0->getUser(); // line 22

PHP Fatal error: Uncaught Auth0\SDK\Exception\CoreException: Invalid state in /var/www/html/auth0/vendor/auth0/auth0-php/src/Auth0.php:558\nStack trace:
#0 /var/www/html/auth0/vendor/auth0/auth0-php/src/Auth0.php(480): Auth0\SDK\Auth0-exchange()\n
#1 /var/www/html/auth0/index.php(22): Auth0\SDK\Auth0->getUser()
#2 {main}\n thrown in /var/www/html/auth0/vendor/auth0/auth0-php/src/Auth0.php on line 558

here is my rather simple code from my console when i selected php:


error_log("\n" . 'STARTING RUN');


require 'vendor/autoload.php';
use Auth0\SDK\Auth0;

$auth0 = new Auth0([
  'domain' => '',
  'client_id' => 'LXXXXXXXXXXXX3',
  'redirect_uri' => '',
  'persist_id_token' => true,
  'persist_access_token' => true,
  'persist_refresh_token' => true,

error_log('NOW trying to get userInfo.');

$userInfo = $auth0->getUser();

error_log('$userInfo: ' . print_r($userInfo,1));

if (!$userInfo) {
error_log('logging in:');
                                                //echo '<a href="login.php">Log In</a>';
    // We have no user info
    // See below for how to add a login link
} else {
        error_log('We have userInfo ');
        printf( "Hello %s!", htmlspecialchars( $userInfo['name'] ) );
    // User is authenticated
    // See below for how to display user information

// login.php

require 'vendor/autoload.php';
use Auth0\SDK\Auth0;

$auth0 = new Auth0([
  'domain' => '',
  'client_id' => 'LXXXXXXXXXXXXXXXX3',
  'client_secret' => 'XXXXXXXXXXXXXXXXXXXXXXm',
  'redirect_uri' => '',
  'scope' => 'openid profile email',


EDIT: the code above does not seem to work for MSN either, but at least with MSN it does not cause an “invalid state” error, instead it just keeps going back to the login page after every successful msn login.