This is my code
<?php
session_start();
require_once("facebook-sdk/autoload.php");
require_once("facebook-sdk/src/Facebook/FacebookSession.php");
require_once("facebook-sdk/src/Facebook/FacebookRequest.php");
require_once("facebook-sdk/src/Facebook/FacebookResponse.php");
require_once("facebook-sdk/src/Facebook/FacebookSDKException.php");
require_once("facebook-sdk/src/Facebook/FacebookRequestException.php");
require_once("facebook-sdk/src/Facebook/FacebookRedirectLoginHelper.php");
require_once("facebook-sdk/src/Facebook/FacebookAuthorizationException.php");
require_once("facebook-sdk/src/Facebook/GraphObject.php");
require_once("facebook-sdk/src/Facebook/GraphSessionInfo.php");
require_once("facebook-sdk/src/Facebook/GraphUser.php");
require_once("facebook-sdk/src/Facebook/Entities/AccessToken.php");
require_once("facebook-sdk/src/Facebook/HttpClients/FacebookCurl.php");
require_once("facebook-sdk/src/Facebook/HttpClients/FacebookHttpable.php");
require_once("facebook-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php");
use Facebook\FacebookSession;
use Facebook\FacebookRequest;
use Facebook\FacebookResponse;
use Facebook\FacebookSDKException;
use Facebook\FacebookRequestException;
use Facebook\FacebookRedirectLoginHelper;
use Facebook\FacebookAuthorizationException;
use Facebook\GraphObject;
use Facebook\GraphSessionInfo;
use Facebook\GraphUser;
use Facebook\HttpClients\FacebookCurl;
use Facebook\Entities\AccessToken;
use Facebook\HttpClients\FacebookHttpable;
use Facebook\HttpClients\FacebookCurlHttpClient;
$api_id="452545828240757";
$api_secret="30be684049..............";
FacebookSession::setDefaultApplication($api_id,$api_secret);
$session = new FacebookSession('452545828240757|n-4BLMHDlsgsXSvqr-YlUgXGk_8');
try {
$response = (new FacebookRequest($session, 'GET', '/me'))->execute();
$object = $response->getGraphObject();
echo $object->getProperty('name');
}
catch (FacebookRequestException $ex) {
echo $ex->getMessage();
}
catch (\Exception $ex) {
echo $ex->getMessage();
}
?>
After executing the code, I got the following message
"An active access token must be used to query information about the current user."
Please help me guys, I don't what is the problem and I want to get user information