0

why I press 'logout' it just logout my websites, But google account is still login state?

test sites below: http://www.hyh.clhyc.tw/GoogleSDK/index.php

my php code: http://www.hyh.clhyc.tw/GoogleSDK/phpCode.txt

Matt_HYH
  • 11
  • 4
  • That's how it works. Why should your website be able to log me out of a different one? If I want to log out of Google, I'll go there to do it. – ceejayoz Sep 05 '16 at 13:37

1 Answers1

0
if (isset($_REQUEST['logout'])) {
  unset($_SESSION['token']);
  session_destroy();
  $gClient->revokeToken();
  header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); //redirect user back to page
}

when logout is clicked the token get destroyed, it doesn't logout of google all the token does is it authorizes your app to interact with the users account enter image description here

once the token expired or revoked the user needs to reauthorize your app to interact with their account.

If you you want to logout of their google account you can read here

Community
  • 1
  • 1
YesItsMe
  • 1,709
  • 16
  • 32