• Register
0 votes
585 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

Please log in or register to answer this question.

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 384 views
384 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 91 views
91 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, 2020 morrisBson 3.2k points
0 votes
1 answer 10 views
10 views
Problem: Hey i am having this invalid session .. please help me to solve it .. invalid requester (person or application), possible invalid/expired session
asked Apr 1 Ifra 37.2k points
0 votes
1 answer 8 views
8 views
Problem: I need music without ads
asked Apr 17 niyatiry 3.9k points
0 votes
1 answer 5 views
5 views
Problem Does their API allow my Facebook-connected user to add a friend? I wonder if someone could help me to
asked Apr 10 neeraj 10.5k points
0 votes
1 answer 7 views
7 views
Problem: Please help me &hellip; how can I solve it? How to find facebook friends on spotify?
asked Mar 19 Ifra 37.2k points
0 votes
1 answer 9 views
9 views
Problem: As I mentioned in my previous query, I'm having difficulties with my learning; I've tried searching the web but haven't been able to find adequate information; could you assist me in continuing my project?
asked Apr 1 rakib1 51.5k points
0 votes
1 answer 180 views
180 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, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 2 views
2 views
Problem: What exactly is an API key and what are its uses?
asked Apr 13 Humaira ahmed 50.7k points
0 votes
1 answer 3 views
3 views
Problem: Asked few friends but no solution, please help >Facebook you don't have permission to access this profile
asked 4 days ago Sawyer Parviz 13.5k points