Clear session data for Facebook server-side when doing FB.logout() on the client

If you log out of FB on the client side using JavaScript:

FB.logout();

And you are running a back-end, where you want to forget FB session (is there a better way?), then you can use the following:

$facebook = new Facebook($fb_config);
$facebook->destroySession();

Yeah…  I know…  stupid easy.  I kept wondering why, despite logging out, I was still pulling FB user id on the client side.

Update: used to do setSession( NULL ), which was wrong…  not sure how I didn’t notice that.  Anyway, destroySession works now.  My apologies.

Advertisements

Leave a comment

Filed under Development

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s