I did some searches and I didn\'t find anything that was related to my problem.
I\'m currently trying to implement a Facebook login to my website and I\'m having pro
The Facebook SDK code has a bug when checking against tokens twice in the same handler.
I edited the getCode function of facebook.php like this:
protected function getCode() {
if (!isset($_REQUEST['code']) || !isset($_REQUEST['state']) || $this->state === null) {
return false;
}
if ($this->state === $_REQUEST['state']) {
// CSRF state has done its job, so clear it
$this->state = null;
$this->clearPersistentData('state');
return $_REQUEST['code'];
}
self::errorLog('CSRF state token does not match one provided.');
return false;
}
to be more clear and does not state an invalid token if called twice.
To be clear the function can be called twice on the same URL handler if for example:
$facebook->getUser(); and then in the same handler $facebook->getLogoutUrl() then the getCode() is called twice thus resulting into and invalid error message