i\'m trying to get Facebook user id using the php sdk like this
$fb = new Facebook\\Facebook([
\'app_id\' => \'11111111111\',
\'app_secret\' =>
Lots of great answers already mentioned, here is the one which helped for me,
I found that the problem is Cross-site request forgery validation failed. Required param “state” missing in FB code and here is the solution
After this line
$helper = $fb->getRedirectLoginHelper();
Add the below code,
if (isset($_GET['state'])) {
$helper->getPersistentDataHandler()->set('state', $_GET['state']);
}