Note that there are some explanatory texts on larger screens.

plurals
  1. POfacebook Uncaught OAuthException: An active access token must be used to query information about the current user
    primarykey
    data
    text
    <p>I've been struggling to find out what is happening with this. My scripts were working fine for a bit and suddenly half stopped.</p> <p>I'm accessing the api and am getting back an access token. With the access token, I can access a users public info just fine. However, when I try to post info to their FB account I get this error.</p> <pre><code>Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. </code></pre> <p>Any idea what is happening here? I'm also using sessions on my site to keep track of internal user ids. Not sure if my sessions could be causing a problem.</p> <p>This is my upload script where I'm getting an error.</p> <pre><code>require 'facebook/src/facebook.php'; // Create our Application instance (replace this with your appId and secret). $facebook = new Facebook(array( 'appId' =&gt; '12345678', 'secret' =&gt; 'REMOVED', 'fileUpload' =&gt; true, 'cookie' =&gt; true, )); $facebook-&gt;setFileUploadSupport(true); $me = null; // Session based API call. if ($session) { try { $uid = $facebook-&gt;getUser(); $me = $facebook-&gt;api('/me'); } catch (FacebookApiException $e) { error_log($e); } } // login or logout url will be needed depending on current user state. if ($me) { $logoutUrl = $facebook-&gt;getLogoutUrl(); } else { $loginUrl = $facebook-&gt;getLoginUrl(); } $photo_details = array('message' =&gt; 'my place'); $file='photos/my.jpg'; //Example image file $photo_details['image'] = '@' . realpath($file); $upload_photo = $facebook-&gt;api('/me/photos', 'post', $photo_details); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload