I’m using the facebook JavaScript SDK, and I want to logout only from my application and keep the user’s Facebook session opened.
I tried using the function FB.logout(), but what they say on the documentation is: “Log the user out of your site and Facebook”. And I don’t want that.
http://developers.facebook.com/docs/reference/javascript/FB.logout/
Any suggestions or code snippets?
Thanks in advance.
There is no such thing as a “logout” from an app.
When the user is logged into Facebook and your site embeds the JS SDK, then the user is recognized by Facebook when he visits your site, and given a temporary access token, that will last for about two hours.
The only way to invalidate that token before it expires, is to use
FB.logout.You could delete the permissions the user has given your app – but then you’d have to ask for them again next times he visits resp. they are needed.
Apart from that, I can hardly think of a scenario where I as a user would want to log out of an app only, but not out of Facebook at the same time.