Logout

Feb 24, 2010 at 10:51 AM
Edited Feb 24, 2010 at 11:38 AM

Hi all

I did search the forum for this. But couldnt quite find it

 

When the user clicks on Logout Link on my site, I want to sign out from my site and as well as from Facebook too...

Which API call should I user

I tried the following

 

   if (connectSession.IsConnected())
            {
                User.GetLoggedInUserInfo = null;
                API.Session.SessionKey = "my key";
                API.Session.SessionSecret = "my secret";
                API.Application.Session.Logout();
                API.Session.Logout();
                API.Connect.Session.Logout();
                connectSession.Logout();
                            }

 

Feb 26, 2010 at 6:15 AM

at least some body tell me, its not a vain question

Mar 28, 2010 at 8:28 PM

I am trying to do the same thing. So far I have been unable to, looking online I have seen posts that say we need to delete the facebook cookies, but I tried that and it still does not work. Has anyone got this working?

Mar 29, 2010 at 7:56 AM

So after doing much research, I resorted to using javascript to logout the user. The following javascript actually works:

FB.Connect.logout();

I looked in the C# source, and the ConnectSession.Logout() method does not have any implementation. The only implementation the API has is for Desktop sessions which is why doing this for Facebook Connect session did not work. I tried also doing a POST to www.facebook.com/logout.php with confirm=1 but that did not work for me as well, so when I tested the javascript above and it worked I just stuck with it. Thanks!

Apr 8, 2010 at 8:23 PM

@bmarrelli:

Could you post your solution here?

FB.Connect.logout(); what is FB in this case?

You code sample would definately help! :)

Thanks!

Sep 3, 2010 at 12:57 AM

I don't get it