我登录时收到此错误:
Facebook SDK returned an error: Cross-site request forgery validation failed. The "state" param from the URL and session do not match.
login.php
有以下代码:
<?php
session_start();
include 'config.php';
/import sdk login.php
require PATH.FOLDER.'facebook-php-sdk-master\\src\\Facebook\\autoload.php';
//do login operation
$fb = new Facebook\Facebook([
'app_id' => APPID,
'app_secret' => APPSECRET,
'default_graph_version' => 'v2.8',
]);
$helper = $fb->getRedirectLoginHelper();
$permissions = ['email', 'public_profile']; // Optional permissions
$loginUrl = $helper->getLoginUrl(INDIRIZZORITORNO, $permissions);
//echo '<a href="' . $loginUrl . '">Log in with Facebook!</a>';
header("Location: ".$loginUrl);
?>
任何人都可以帮助我?