Tuesday, March 19, 2013

PHP facebook logout?


//for some reason, facebook getlogouturl does not seems to be able to populate access_token byitself.
//Therefore this method forces it to attach the access token:
$logoutUrl = $facebook->getLogoutUrl(array(
        "next" => "yourdomain.com?logout=1", "access_token" => $facebook->getAccessToken()
      ));
$facebook->destroySession();
<script>

document.location.href="<?=$logoutUrl?>";

</script>


No comments: