Google Sign in API - How do I log someone out with PHP?

Viewed 4858

On Google's Integrate Google Sign-In page it has the section at the bottom that shows you how to sign the user out using Javascript:

<a href="#" onclick="signOut();">Sign out</a>
<script>
  function signOut() {
    var auth2 = gapi.auth2.getAuthInstance();
    auth2.signOut().then(function () {
      console.log('User signed out.');
    });
  }
</script>

I have been looking and I can't find a way to sign the user out like this using PHP.

I did find how to sign a user completely out of Google, but I don't want that. I also know I can delete the $_SESSION variable that holds the access code, but that still isn't completely what I want.

Does anyone know how I can log someone out of my Google application using PHP?

5 Answers
Related