Facebook Login using HybridAuth showing error You cannot access this page directly

核能气质少年 提交于 2019-12-04 11:30:18

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

I had the same issue. It relates to our custom session handler which is set by session_set_save_handler(). Hybrid Auth uses standard PHP sessions, so after redirecting and opening a new session, Hybrid Auth starts using standard PHP file sessions instead of your custom session handler. This result in the loss of config data from our session and getting this error message.

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.

Israel Fagundes

For anyone with the same problem have a question: The file that calls the API is in the same directory it?

Me only worked when I put my file in the same folder as the config.php file. Try it there and tell me if it works!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!