views:

22

answers:

1

Hi,

I am using facebook connect on my site. I use some code to retrive data from facebook like Profile Information, Friends list etc.

My session will not expire until I close the browser manualy.

What code should I use on my logout page so that the session will expire automatically?

+1  A: 

Assuming you already have the FB Javascript library included (like this):

<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"&gt;
</script> 

you can use FB.logout():

<a href="#" onclick="FB.logout();return false;">Logout</a>

Note that this will log out the user from FB Connect and Facebook.

Piskvor

related questions