FB connect logout problem: Logs out from FB site

Sandesh picture Sandesh · Oct 27, 2010 · Viewed 7.8k times · Source

When I logout from my site using FB connect, Facebook account also logged out. I need a alternate logout option, so that only fb session of my site destroyed, not from the actual fb site.

Answer

Ben Taitelbaum picture Ben Taitelbaum · Oct 27, 2010

Unfortunately, this is the behavior that Facebook calls for: FB.logout API Reference

I think the idea is that most people will stay logged in to Facebook, and so will automatically be logged in to all the FB connect sites they go to as well (after granting permission to those sites), so that they don't have to worry about logging in. Then, if it's a public computer or they need to logout of one site, FB makes sure they log out of them all.

If you want different semantics, you could always provide a logout button that instead of calling FB.logout, just marks their session as no longer connected (delete the appropriate cookies, change whatever you need to server side), but I'd just stick with the default behavior (many sites show a popup saying that you'll be logged out of FB as well).