• Register
0 votes
48 views

Problem :

I am struggling to find out what is actually happening with my code. My scripts were working fine for some time and suddenly they have half stopped.

I am trying to access my api and I am getting back the access token. With my access token, I can access the users public info just correctly. But, when I want to post any info to their FB account I face below error.

Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user.

Any idea regarding this what is happening with my code? I am also trying to use sessions on the site to keep track of the internal user ids. Unable to know if my sessions could be causing the problem.

6 5 3
7,540 points

1 Answer

0 votes

Solution :

I also had the similar issue in the recent past, and it was happening because I was just saving my access token but was not using it. It may be because I had made some silly mistakes because of the due dates pressure, or maybe I just forgot about it! But in any case anyone else is in a same situation:

Now whenever I log in as user I save my access token as below :

$facebook = new Facebook(array(
'myappId' => <insert the app id which you got from facebook here>,
'mysecret' => <insert the app secret which you got from facebook here>
));
$myaccessToken = $facebook->getAccessToken();
//save your access token for later

 

9 7 4
38,600 points

Related questions

1 vote
1 answer 43 views
43 views
Problem : Currently I am struggling to find out what is actually happening with my code. My all scripts were working really fine previously but now they are suddenly half stopped. I am trying to access the api but I am getting back the access token. ... am facing below error : Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user.
asked Dec 30, 2019 alecxe 7.5k points
1 vote
1 answer 39 views
39 views
Problem : I am very new to Facebook programming. Currently I want to run a very simple code for Facebook connect which I have already written but now a days I often face below error message : [error] => Array             (                 [message] => An active ... I want expert help here to fix above error as I have already wasted couple of days in debugging above error but no successes yet.
asked Apr 8 morrisBson 3.2k points
0 votes
1 answer 45 views
45 views
Problem : I am very new to SQL.I and my colleague have recently joined SQL project now I have a table on my SQL Server and I want to export the structure of the table so that I can send it to my colleague. Which SQL command should one fire to get the required table structure? Please note that I don't have any access to the SQL Server Management Studio.
asked Jan 27 jwilliam 3.9k points
0 votes
1 answer 24 views
24 views
Problem: I am new to Geocoding. I want to program the geocoding. I have already created the API key but if I add it into my current website code then surprisingly I do not get anything and if I do not use the API then somehow everything starts working again. Whenever ... Google Maps Geocoding API is turned on. Kindly tell me if the API key has to be activated also somewhere else to make it work?
asked Jun 17 Raphael Pacheco 4.9k points