I'm trying to simply log a user out of fb before continuing on to log them out of my system.
Here's what I'm trying:
require_once '/src/facebook.php';
$facebook = new Facebook(array( 'appId' => 'MY_APP_ID', 'secret' => 'MY_SECRET' ));
$fb_userID = null;
$fb_userID = $facebook->getUser();
$access_token = $facebook->getAccessToken();
if($fb_userID){
$logoutUrl = $facebook->getLogoutUrl( array ('next' => 'http://myurl.com/pages/userlogin.html?logoff=true'));
}
echo "<a href="$logoutUrl">Log-out</a>";
When I do this not only does it not work but the end of the URL shows access_token=0
If I try the following instead I get the access token but it stil doesn't work
$logoutUrl = "https://www.facebook.com/logout.php?next=http://myurl.com/pages/userlogin.html?logoff=true&access_token=$access_token";
Is there a better way of doing this?