title: Facebook PHP SDK: Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user
body: <p>I am using the PHP SDK to handle my Facebook connects. Everything was working fine for some time but my script suddenly stopped working. Here is what happens:</p>
  
  <pre><code>$facebook = new Facebook(array('appId' =&gt; $app_id, 'secret' =&gt; $app_secret, 'cookie' =&gt; true));
  
  $user = $facebook-&gt;getUser();
  
  if ($user) {
  
      $permissions = $facebook-&gt;api('/me/permissions');
  
  } else {
  
      $params = array();
      $params['scope'] = 'publish_actions,user_photos';
      header('Location: ' . $facebook-&gt;getLoginUrl($params));
      exit();
  
  }
  </code></pre>
  
  <p>Returns: Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user.</p>
  
  <p>The error is caused by the line</p>
  
  <pre><code>$permissions = $facebook-&gt;api('/me/permissions');
  </code></pre>
  
  <p>Any suggestions?</p>