Facebook endless redirect loop during authentication

I get an infinite loop in URL redirection after the user either logs in or has already registered. The page is redirected to the login page if the user has not logged in as expected, but enters the loop as soon as he enters credentials.

Below is the code:

<?php include_once ('facebook.php'); $api_key = 'xxxxxxxxxxxx'; $secret = 'xxxxxxxxxxxx'; global $facebook; $facebook = new Facebook($api_key, $secret); $facebook->require_frame(); $uid = $facebook->require_login($required_permissions = 'email,status_update,offline_access'); $facebook->api_client->users_hasAppPermission("offline_access",$uid); #echo $uid; # $facebook->api_client->users_setStatus("hello",$uid); # echo "<p>Your status has been updated</p>"; ?> 

Interestingly, this code worked before, but suddenly started giving me an endless loop problem. There has been some discussion on the facebook forum about this, but no indication which is a bug or what is the workaround.

Any help would be greatly appreciated.

thanks

+4
source share
1 answer

I added code for direct logon only if the user did not log in otherwise, do not do this. It worked for me! .. Hope it helps.

 $is_tab = isset($_POST['fb_sig_in_profile_tab']); if( !$is_tab ){ $uid = $facebook->require_login($required_permissions = 'email,status_update ,offline_access'); } else{ $uid = $facebook->get_profile_user(); } 
+4
source

All Articles