i have created a forum using php/mysql and users login through facebook using php sdk. the login works perfectly. the logout however does not. I have not tried the javascript sdk and it is supposted to work . but i need a solution in PHP.
Here are the two things that i have tried.
//this is signout .php
$logoutURL=$facebook->getLogoutURL(array(‘next’=’http://localhost/php_lessons/forum_facebook/logout_page.php’));
header(‘Location:’.$logoutURL);
//this is signout.php
$ACCESS_TOKEN=$facebook->getAccessToken();
$REDIRECT=’http://localhost/php_lessons/forum_facebook/logout_page.php’;
“https://www.facebook.com/logout.php?access_token=ACCESS_TOKEN&confirm=1&next=REDIRECT”
both the solutions take me to facebook/home.php of the user that is trying to logout. (me for test purposes).
The logout problem is because of a recent Facebook API change – ‘offline_access Permission Removal’.
Disable the ‘Deprecate offline access’ setting from Edit App > Advanced > Migrations tab
You can read more about it at: http://developers.facebook.com/roadmap/offline-access-removal/