我对 Facebook SDK 有疑问。我不断收到以下错误:
CSRF 状态令牌与提供的不匹配
我没有之前建议的任何 RewriteRule 规则,所以这不是问题。为了知道问题出在哪里,我将 getCode() 函数更改为以下内容:
protected function getCode() {
if (isset($_REQUEST['code'])) {
if ($this->state !== null &&
isset($_REQUEST['state']) &&
$this->state === $_REQUEST['state']) {
// CSRF state has done its job, so clear it
$this->state = null;
$this->clearPersistentData('state');
return $_REQUEST['code'];
} else {
$add = "";
if ($this->state == null)
$add .= " State is null";
if (!isset($_REQUEST['state']))
$add .= " State is not set";
if ($this->state !== $_REQUEST['state'])
$add .= " States are not that same";
self::errorLog('CSRF state token does not match one provided. problem:' . $add);
return false;
}
}
return false;
}
现在重新运行登录脚本后,出现以下错误:
CSRF 状态令牌与提供的不匹配。问题:状态为空状态不一样
有谁知道如何解决这个问题?
谢谢