title: facebook Uncaught OAuthException: Error validating access token
body: <p>I'm using facebook connect on my website, I'm authenticating using fb javascript sdk, and also using fb php sdk for getting users information, everything works fine but when the user logs out from facebook (from next tab), the php sdk throws an exception</p>
  
  <blockquote>
    <p>Fatal error: Uncaught OAuthException: Error validating access token:
    The session is invalid because the user logged out. thrown in
    C:\wamp\www\fbjs\base_facebook.php on line 1033</p>
  </blockquote>
  
  <p>After Logout from facebook the site behaves strange, I can get user id through this code even after the fb logout</p>
  
  <pre><code>$user = $facebook-&gt;getUser();///get my fb id
  </code></pre>
  
  <p>but then on next line it calls the api using the facebook object then it throw the above exception.</p>
  
  <p>Any idea how can I check if the is the user is still on fb or not b/c I get fbid but exception on <code>$facebook-&gt;api</code>  call.</p>