I'm using the FB PHP SDK to get a user's FB access token etc.
After I'm done getting all my info, I am attempting to logout the user, but it doesn't work. For debugging purposes, I'm doing this:
$facebook = new Facebook(array(
'appId' => FB_APP_ID,
'secret' => FB_SECRET
));
$params = array( 'next' => site_url('welcome/logout') );
$link = $facebook->getLogoutUrl($params); // $params is optional.
echo $link;
This gives me a link like this:
https://www.facebook.com/logout.php?next=http%3A%2F%2Fexample.com%2Fwelcome%2Flogout&access_token=xxxxxxxx
If I point my browser to that URL, I get redirected back to my callback URL, but immediately after, if I go to Facebook.com, I'm still logged in.
What am I doing wrong?
I tried using the JS SDK but that doesn't work because everything else is being done server side (using the PHP SDK). So, when I call FB.logout()
using the JS SDK, it says Logout called without access token
.
EDIT
I suppose before proceeding further, could someone confirm this: When I follow the logout URL, does it actually log me out of Facebook, or just end the session between my app and the user?
If that is so, is there any way to completely Log out the user from Facebook? (I'm guessing no).