logout function

May 17, 2011 at 5:59 AM

is there an logout function?

Jun 3, 2011 at 3:47 AM
Edited Jun 3, 2011 at 3:50 AM

Hi, you can try the following, somehow it works for me, and it is based on 1 of the http://stackoverflow.com/ post I saw but I couldn't recall which specific link.

The functionality on the below code does it you click on the image (a hyperlink) and it will log out your facebook account, in otherwords it clears up your facebook cookie session.

 

Include the below codes in BOLD into your ASPX page.

 

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

<head>

    <script type="text/javascript">       

function FBlogout() {           

try {               

FB.Connect.ifUserConnected(function()

{                   

FB.Connect.logoutAndRedirect('default.aspx');               

}, 'default.aspx');           

} catch (e) {               

// your exception message       

}       

}   

</script>   

<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"          type="text/javascript">

</script>

</head>

 

<body>

<a href="#" onclick="FBlogout(); return false;"><img src="images/logout_small.gif" /></a><br />

    <script type="text/javascript">       

FB.init("YOUR APP KEY", "xd_receiver.htm");   

</script>

</body>

 

Inside the xd_receiver.htm file, within the Body tag, include the below linke

       <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script>