{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/473","labels_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/473/labels{/name}","comments_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/473/comments","events_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/473/events","html_url":"https://github.com/facebook/facebook-php-sdk-v4/issues/473","id":96408401,"number":473,"title":"Facebook SDK returned an error: Cross-site request forgery validation failed. Required param \"state\" missing.","user":{"login":"tatters1979","id":1915928,"avatar_url":"https://avatars.githubusercontent.com/u/1915928?v=3","gravatar_id":"","url":"https://api.github.com/users/tatters1979","html_url":"https://github.com/tatters1979","followers_url":"https://api.github.com/users/tatters1979/followers","following_url":"https://api.github.com/users/tatters1979/following{/other_user}","gists_url":"https://api.github.com/users/tatters1979/gists{/gist_id}","starred_url":"https://api.github.com/users/tatters1979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatters1979/subscriptions","organizations_url":"https://api.github.com/users/tatters1979/orgs","repos_url":"https://api.github.com/users/tatters1979/repos","events_url":"https://api.github.com/users/tatters1979/events{/privacy}","received_events_url":"https://api.github.com/users/tatters1979/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-07-21T20:22:17Z","updated_at":"2015-07-22T21:55:06Z","closed_at":null,"body":"Hi, I've moved to the latest version of the SDK and tried the simple login example for starters and it was working fine a few days ago. However I now get the following error:\r\n\r\n   Facebook SDK returned an error: Cross-site request forgery validation failed. Required param \"state\" missing.\r\n\r\nI can't figure out the problem, I've had a look at the following section of the Helper.\r\n\r\n     /**\r\n     * Validate the request against a cross-site request forgery.\r\n     *\r\n     * @throws FacebookSDKException\r\n     */\r\n    protected function validateCsrf()\r\n    {\r\n        $state = $this->getState();\r\n        $savedState = $this->persistentDataHandler->get('state');\r\n\r\n       if (!$state || !$savedState) {\r\n            throw new FacebookSDKException('Cross-site request forgery validation failed. Required param \"state\" missing.');\r\n        }\r\n\r\n        $savedLen = strlen($savedState);\r\n        $givenLen = strlen($state);\r\n\r\n        if ($savedLen !== $givenLen) {\r\n            throw new FacebookSDKException('Cross-site request forgery validation failed. The \"state\" param from the URL and session do not match.');\r\n        }\r\n\r\n        $result = 0;\r\n        for ($i = 0; $i < $savedLen; $i++) {\r\n            $result |= ord($state[$i]) ^ ord($savedState[$i]);\r\n        }\r\n\r\n        if ($result !== 0) {\r\n            throw new FacebookSDKException('Cross-site request forgery validation failed. The \"state\" param from the URL and session do not match.');\r\n        }\r\n    }\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/comments/123878230","html_url":"https://github.com/facebook/facebook-php-sdk-v4/issues/473#issuecomment-123878230","issue_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/473","id":123878230,"user":{"login":"SammyK","id":578780,"avatar_url":"https://avatars.githubusercontent.com/u/578780?v=3","gravatar_id":"","url":"https://api.github.com/users/SammyK","html_url":"https://github.com/SammyK","followers_url":"https://api.github.com/users/SammyK/followers","following_url":"https://api.github.com/users/SammyK/following{/other_user}","gists_url":"https://api.github.com/users/SammyK/gists{/gist_id}","starred_url":"https://api.github.com/users/SammyK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SammyK/subscriptions","organizations_url":"https://api.github.com/users/SammyK/orgs","repos_url":"https://api.github.com/users/SammyK/repos","events_url":"https://api.github.com/users/SammyK/events{/privacy}","received_events_url":"https://api.github.com/users/SammyK/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T21:55:06Z","updated_at":"2015-07-22T21:55:06Z","body":"Np! Hopefully we'll be able to nip this one in the bud."}}