4

I have working with Google OpenId API for my website. I need to implement the Force Logout Concept with Google OpenId API.

Below code i have tried, but I can't get the actual solution for force logout with openId.

How do I logout the Current Login Session in Google OpenId?

<?php

session_start();
if (isset($_SESSION['id'])) 
{
    // Redirection to login page.
    header("location: home.php");
}

if (array_key_exists("login", $_GET)) {
    $oauth_provider = $_GET['oauth_provider'];
    if ($oauth_provider == 'google') {

     $url='https://www.google.com/accounts/Logout';

  //After clearing a session it is redirected to  login-google.php

    $redirectUrl="login-google.php";

    $redirectUrl = '&return='.$redirectUrl;

    $finalUrl = $url . $redirectUrl;

   echo("<script>top.location.href='".$finalUrl."'</script>");

    } 
}
?>
ahalya
  • 47
  • 1
  • 5
  • take a look at this link, hope it helps, and i am currently facing the problem just like yours too... hope this helps. https://stackoverflow.com/questions/4202161/google-account-logout-and-redirect – Bizarre Dec 29 '12 at 03:33

0 Answers0