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
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
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
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