How can I log a user out from my facebook connect website, without using the fb-login button? I would like to do it from codebehind (c#)?
I found out that there was only an option to do it from Javascript by FB.logout()
. It seems kinda wird that there is no API from codebehind to do the same.
If you just want a simple link to log out the user, you can form a url like this:
https://www.facebook.com/logout.php?access_token=ACCESS_TOKEN&confirm=1&next=REDIRECT
Just replace ACCESS_TOKEN
and REDIRECT
with the appropriate values. Facebook changes this every now and then, so you have to watch out for that. This only works in the browser, but the nice thing about doing it this way is that the user doesn't have to wait for the JavaScript library to load.