I have a fairly basic problem using the facebook php SDK in conjunction with the JS SDK. I have the login button which works fine but once the user is logged in and presses the logout button, I retrieve the logout URL as follows:
$logoutUrl = $facebook->getLogoutUrl(array('next' => 'http://mysite.com/'));
The user is then logged out of my site but facebook as well. How can I prevent the user from being logged out of facebook? I only want him/her to be logged out of my site.
Any help is greatly appreciated 🙂 Merry Christmas everyone!
If you rely on Facebook for authentication of users, will need to implement your own “logout” mechanism to do this, which is actually only way to do it without logout your users from Facebook since Facebook doesn’t provide functionality for this.
Since you are not responsible on the auth here, you may place some cookie that indicated user is logged out of your site (which is only mocking things, you still know who he is) and prevent him from interaction with your site/app or display content for unauthorized users. If user is doing login with
FB.loginyou cansubscribeforauth.login,auth.authResponseChangeandauth.statusChangeto check his status and remove cookie placed before to allow him log-in.