开发者

problem with facebook api - Keeps redirecting

开发者 https://www.devze.com 2022-12-14 04:59 出处:网络
I created an application with aname and connect URL on facebook. I put below codein test.php here (test.php):

I created an application with a name and connect URL on facebook.

I put below code in test.php here (test.php):

include_once 'facebook.php';
$fb = new Facebook('api_key', 'secret');
$user = $fb->require_login();
echo $fb->api_client->user;    
echo $fb->api_client->session_key;

when I go to that page, it takes me to facebook login, after I login it redirects me to same test.php with an auth_token. But it doesn't stop there. For some reason, the script is taking me to facebook again and since I already logged in facebook redirecting me to test.php with another auth_token just like below

/t开发者_StackOverflow中文版est.php?auth_token=76a6eb21b872cdfe787ea85a240905dd&auth_token=597d7532bf53c8ce37cc003bcf7d2905

It never stops there, test.php taking me to facebook again and again :(

Please tell me what wrong??

Thanks a lot


adda line: $facebook->require_frame();

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号