Reputation:
So, I am aware that the issue has been raised a number of times. But most of the questions are old and after browsing for at least one hour, I have yet to find a good answer to this issue.
I am using the official Facebook PHP SDK for my website. My application lets the users log in and out. Problem is, you can't really log out. The only way to get back to the login page is to clear the cookies manually. This is just such a basic issue, surely there must be an easy solution?
$facebook = new Facebook($config);
$me = $facebook->api('/me');
if ($me) {
$logoutUrl = $facebook->getLogoutUrl();
}
Upvotes: 1
Views: 4679
Reputation: 794
$facebook -> destroySession();
works for me.
As well as manually clearing the fbsr_ cookie
setcookie("fbsr_YOUR_APP_ID",'',time()-10);
Upvotes: 6