Facebook SDK returned an error: Cross-site request forgery validation failed. The state param from the URL and session do not match
<p>I'm working with Laravel 5.2 and I'm using SammyK/laravel-facebook-sdk Package i Tried the code in the following link <a href="https://github.com/SammyK/LaravelFacebookSdk#installation" rel="nofollow">enter link description here</a> </p>

<p>I keep on having this error : "Cross-site request forgery validation failed. The "state" param from the URL and session do not match."</p>

<p>this is my controller code : </p>

<pre><code>public function callbackfbsdk(Facebook $fb){


$helper = $fb::getRedirectLoginHelper();

$loginUrl = $helper-&gt;getLoginUrl(['email']);

var_dump($loginUrl);

try {
    $token = $fb::getAccessTokenFromRedirect();
} catch (Facebook\Exceptions\FacebookSDKException $e) {
    dd($e-&gt;getMessage());
}

if (! $token) {
    // Get the redirect helper
    $helper = $fb::getRedirectLoginHelper();

    if (! $helper-&gt;getError()) {
        abort(403, 'Unauthorized action.');
    }

    // User denied the request
    dd(
        $helper-&gt;getError(),
        $helper-&gt;getErrorCode(),
        $helper-&gt;getErrorReason(),
        $helper-&gt;getErrorDescription()
    );
}

if (! $token-&gt;isLongLived()) {
    $oauth_client = $fb::getOAuth2Client();

    try {
        $token = $oauth_client-&gt;getLongLivedAccessToken($token);
    } catch (Facebook\Exceptions\FacebookSDKException $e) {
        dd($e-&gt;getMessage());
    }
}

$fb::setDefaultAccessToken($token);

Session::put('fb_user_access_token', (string) $token);

try {
    $response = $fb::get('/me?fields=id,name,email');
} catch (Facebook\Exceptions\FacebookSDKException $e) {
    dd($e-&gt;getMessage());
}

$facebook_user = $response-&gt;getGraphUser();

$user = App\User::createOrUpdateGraphNode($facebook_user);

// Log the user into Laravel
Auth::login($user);

return redirect('/')-&gt;with('message', 'Successfully logged in with Facebook');
</code></pre>

<p>}</p>

<p>Any Ideas about how can I solve this error??</p>