You cannot access this page directly - HybridAuth Social Login

前端 未结 5 1219
逝去的感伤
逝去的感伤 2020-12-17 04:03

I am using HybridAuth social plugin in my website to login from facebook and other websites,

everything is working fine, but when I checked on other computers, there

相关标签:
5条回答
  • 2020-12-17 04:47

    adding "www." to the URL resolves the issue.

    0 讨论(0)
  • 2020-12-17 04:49

    After adding this on top of my controller it started working

    if (session_status() == PHP_SESSION_NONE) {
        @session_id($_COOKIE['CAKEPHP']);
        @session_start();
        @session_name('CAKEPHP');
    }
    

    Read here https://github.com/hybridauth/CakePHP-HybridAuth/pull/1

    0 讨论(0)
  • 2020-12-17 04:51

    The reasen is because Facebook callback in different php-session and cant access config info from caller session. Look at Endpoint.php if ( ! $storage->config( "CONFIG" ) ) ... The rason was because I use in my site with 127.0.0.1 but return_uri was with localhost because of Facebook restrictions. PHP builds different sessions in this case.

    0 讨论(0)
  • 2020-12-17 04:52

    This could be related by using a custom session handler which is set by session_set_save_handler(). I resolved this issue by adding our own custom session handler at the top of hybridauth/index.php (located in the same dir as config.php and live.php). This forces Hybrid Auth to use your custom session handler.

    0 讨论(0)
  • 2020-12-17 04:57

    Those who are facing error message "You cannot access this page directly."

    Try after adding @session_start(); statement at the top of your files.

    0 讨论(0)
提交回复
热议问题