So I have effectively integrated Facebook into my Wordpress site. I have also linked together the accounts. However, how a site works is the fact that you are either drenched in to the site through the

  1. Wordpress Account
  2. Facebook Account or
  3. Wordpress &lifier Facebook

I understand how to log from Facebook and I understand how to log from Wordpress, however the two techniques are utilizing Javascript and PHP correspondingly.

Wouldso would I, with one logout link, use both PHP and Javascript logout techniques?

I'd use Ajax. You are able to call the javascript function along with a php script. For those who have no clue how ajax works a very good way to do is applying jQuery.post.

I solved this problem by utilizing FB.Connect.logoutAndRedirect()

<a href="#" onclick="FB.Connect.logoutAndRedirect('/fb_logout.php')">Sign out</a>

as well as in facebook_logout.php I made use of: session_destroy(); like:

<?php 
session_destroy();
header('Location: http://yoursite.com');

Which appears to operate pretty much.