title: How to log out user using facebook SDK?
body: <p>I am using a <code>facebook</code> log in for my web site using <code>facebook php sdk</code>.  </p>
  
  <p>What I noticed is the <code>logout</code> link doesn't do anything.  After I logout, the user can still navigate the site.  Here is my code in <code>facebook.php</code>:</p>
  
  <pre><code>&lt;?php
      require 'src/facebook.php';
      $facebook = new Facebook(array(
             'appId'  =&gt; '*************',
             'secret' =&gt; '******************************',
      ));
      $user = $facebook-&gt;getUser();
      $loginUrl = $facebook-&gt;getLoginUrl();
      echo "&lt;a href='$loginUrl'&gt;login&lt;/a&gt;";
  
      $logoutUrl = $facebook-&gt;getLogoutUrl();
      echo $loginUrl; 
      if($user){
          session_start() ; 
          $_SESSION['user_info'] = $user; 
          $_SESSION['user_pro']= $facebook-&gt;api('/me');
          print_r($_SESSION);
      }
      else{
          echo 'not logged in '; 
      }
  
      echo "&lt;a href='example.com/logout.php'&gt;log out &lt;/a&gt;"
  ?&gt;
  </code></pre>
  
  <p>This <code>code</code> works fine on log in.  The log out link should destroy the session.  Here is the header of the page: </p>
  
  <pre><code>&lt;?php 
      print_r($_SESSION) ; 
      header('example.com') ; 
  ?&gt;
  </code></pre>
  
  <p>The problem with my <code>logout.php</code> page is it doesn't detect the session at all.  I don't know if this is a <code>facebook api</code> problem or my <code>php</code> problem. </p>
  
  <p>How do you log the user out using the facebook SDK?</p>