Log out of BOTH WordPress & Facebook

So I’ve successfully integrated Facebook into my WordPress site. I’ve also linked together the accounts. However, the way the site works is that you’re either logged into the site via the

  1. WordPress Account
  2. Facebook Account or
  3. WordPress & Facebook

I know how to log out of Facebook and I know how to log out of WordPress, but the two methods are using Javascript and PHP respectively.

Read More

How would I, with one logout link, use both the PHP and Javascript logout methods?

Related posts

Leave a Reply

2 comments

  1. I solved this issue by using FB.Connect.logoutAndRedirect()

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

    and in fb_logout.php I used: session_destroy(); like:

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

    Which seems to work pretty well.