Exception Description
After I use account a login authorization, I get the information of account A and then exit.
After using another account B to access the authorization, the information obtained is still the information of account A.
However, after a period of time (unable to determine how long), and then use account B login authorization, you can obtain the information of account B, and then exit.
Then use account A login, get the information is still account B information, this is how one thing ah?
Test Address: http://www.euask.com/oauth/google.php
Setauthconfigfile (' Client_secrets.json '); $client->setredirecturi (' http://www.euask.com/oauth/google.php '); $ Client->setscopes (Array (' Https://www.googleapis.com/auth/userinfo.email ', ' https://www.googleapis.com/auth/ Plus.login ', ' https://www.googleapis.com/auth/plus.me ');//$client->addscope (google_service_oauth2::userinfo _email); $plus = new Google_service_oauth2 ($client); if (Isset ($_request[' logout ')) {Session_unset ();} if (isset ($_get[' code ')) {$client->authenticate ($_get[' code '); $_session[' access_token '] = $client->getaccesstoken (); $redirect = ' http://www.euask.com/oauth/google.php '; Header (' Location: '. Filter_var ($redirect, Filter_sanitize_url));} if (Isset ($_session[' Access_token ')) && $_session[' Access_token ']) {$client->setaccesstoken ($_session[') Access_token ']); $me = $plus->userinfo->get (); $id = $me [' id ']; $name = $me [' GivenName ']; $email = $me [' email ']; $profile _image_url = $me [' picture '];} else {$auth _url = $clientCreateauthurl ();}? >
"; Print "Name: {$name}
"; Print "Email: {$email}
"; Print "Image: {$profile _image_url}
"; echo "Sign Out"; }?>
Reply content:
Exception description
After I use account a login authorization, I get the information of account A and then exit.
After using another account B to access the authorization, the information obtained is still the information of account A.
However, after a period of time (unable to determine how long), and then use account B login authorization, you can obtain the information of account B, and then exit.
Then use account A login, get the information is still account B information, this is how one thing ah?
Test Address: http://www.euask.com/oauth/google.php
Setauthconfigfile (' Client_secrets.json '); $client->setredirecturi (' http://www.euask.com/oauth/google.php '); $ Client->setscopes (Array (' Https://www.googleapis.com/auth/userinfo.email ', ' https://www.googleapis.com/auth/ Plus.login ', ' https://www.googleapis.com/auth/plus.me ');//$client->addscope (google_service_oauth2::userinfo _email); $plus = new Google_service_oauth2 ($client); if (Isset ($_request[' logout ')) {Session_unset ();} if (isset ($_get[' code ')) {$client->authenticate ($_get[' code '); $_session[' access_token '] = $client->getaccesstoken (); $redirect = ' http://www.euask.com/oauth/google.php '; Header (' Location: '. Filter_var ($redirect, Filter_sanitize_url));} if (Isset ($_session[' Access_token ')) && $_session[' Access_token ']) {$client->setaccesstoken ($_session[') Access_token ']); $me = $plus->userinfo->get (); $id = $me [' id ']; $name = $me [' GivenName ']; $email = $me [' email ']; $profile _image_url = $me [' picture '];} else {$auth _url = $clientCreateauthurl ();}? >
"; Print "Name: {$name}
"; Print "Email: {$email}
"; Print "Image: {$profile _image_url}
"; echo "Sign Out"; }?>