Facebook SDK returned an error: Cross-site request forgery validation failed. The “state” param from the URL and session do not match

后端 未结 25 1039
南方客
南方客 2020-12-01 01:37

i\'m trying to get Facebook user id using the php sdk like this

$fb = new Facebook\\Facebook([
    \'app_id\' => \'11111111111\',
    \'app_secret\' =>         


        
25条回答
  •  死守一世寂寞
    2020-12-01 02:13

    The same issue occurred to me on laravel 5.4 i solved this issue by putting

    session_start();
    

    at the top of the script.

    Below is the sample laravel controller namespace to give you a example how it will work.

    
    

    the issue is occurring because is has not yet started so by adding session start at the top of the script we are just starting the session.

    hope it may help somebody..

提交回复
热议问题