Ok so I’m using Facebook PHP SDK
currently I’m rendering the login/logout buttons as the following:
$facebook = new Facebook(array(
'appId' => $fbAppID,
'secret' => $fbSecret,
'cookie' => true,
));
$uid = $facebook->getUser();
if ($uid != false) {
$button = ' <img src="/fb-logout.png"></img>';
$url = $facebook->getLogoutUrl();
} else {
$button = ' <img src="/fb-login.png"></img>';
$url = $facebook->getLogoutUrl();
}
echo '<a href="' . $url . '">' . $button . '</a>';
But then when a user “Logs Out” using the button with the URL derived from the getlogouturl() function, it logs out from Facebook just fine but it doesn’t log out from my app…ie when I call $facebook->getUser() once again, it returns the user ID again even though he’s not even logged out from facebook
am I doing something wrong? What should I do so that user also logs out from my app when logged out from Facebook
You dont need to “log out” from your app, because thats not handled by the facebook sdk or facebook. The logout in your app is handled by your app and only your app.