Yesterday someone mailed me that my application http://apps.facebook.com/thinkdiffdemo is continuously refreshing. I developed that application 1 year ago for demo purpose. So today I checked and I found yeah its refreshing continuously.
Then I changed the application setting like below and thus the problem solved. So if you also faced this type of problem first check the application setting.
Additionally please update and use the latest php-sdk provided by facebook. Some developers also informed me that it solved their problem.








I have an application based on your demo, it was working all right until yesterday, it begins to do that loop
My migrations setting looks different than this you show in this post:
I enable “upgrade to Request 2.0″ but it is still in the infinite loop.
In this web http://www.foobots.net/breakouts.html talks about this problem but their metod is quite different.
It seem to be happening to many people, what we can do ??
This is my migration settings: http://www.elmerticas.com/settings.jpg
This infinite loop is really a problem, I never faced it but yesterday I found its in my old application and today I fixed it by changing the setting that I published in this post. But normally whatever I think is that, if you call any graph api that require extended permission then provide the permission in the login tag. Otherwise facebook will redirect.
Mahmud – you are a legend! – thank you for this all these really great tutorials and all the developer comments!
I have a general question about your solution – i’ve just looked in my facebook.com/developers application settings – i don’t see ALL the options you’re seeing in your screen shot? – is there another screen i’m missing? – my settings look like Elmers settings at http://www.elmerticas.com/settings.jpg?
Hi Richard,
My application is created 1 year ago, so I get some more settings. Your one is newer compare to mine that’s why you’re seeing less settings.
Thank you!
Thank you Mahmud, I finally stopped this loop, the solution was actually easy, I just download the last version of PHP SDK and thats all
Yeah, latest SDK is very important. I am also using the latest sdk.
hi, where would i copy PHP SDK from?
Thank you
I am sorry,
i found it updated and did the changed as you described
it works very nice again
Thank you very much
put in to your main folder with index file
Mahmud, you are the greatest – thank you so much for the wonderful tutorials – I’ve after a few hrs have managed to setup something basic and its looking good – still work in progress but as soon as I have something more concrete will invite you to have a look
) thanks once again
i hope facebook will announce these kind of revisions. developers are clueless when their working applications suddenly became buggy.
Completely agree with you.
I have the same issue, will try with your suggestion. Thank you.
Your blog can be coverted a very nice book on “Facebook Apps using Graph Api”.
I have learnt a lot from your blog.
Thanks for sharing your knowledge.
Hi mahmud ahsan
Thanks for this, you solved me hours of searching. Simply updating the SKD worked 100%…..
But what i dont understand is why this happened in the first place. And this has happened before…
Hi!
Thanks alot for this post and all the comments. Helped us tremendously.
I am sorry i know this does not belong here but is it possible to make a tutorial how to save application users’ information on a database
thank you
Please check this tutorial http://thinkdiff.net/facebook/users-demographic-data-from-facebook/
Hi mahmud ahsan
Thanks for this, you solved me hours of searching. Simply updating the SKD worked 100%…..
But what i dont understand is why this happened in the first place……
Any your wonderful tutorials has been a real guide for our application developement………….
Once again thankz very much……….
Thanks Mahmud it solved my problem only by updating the SDK.
Fantastic post thanks!
Hi,
with new migration settings, returned session array does not contain $session['session_key'] any more. (This can be striped from $session['access_token'])
Bigger problem is that when user log out from facebook, application is still available with direct access http://apps.facebook.com/appName/ It seems like session remain live.. With previous settings this wasn’t possible..
Any ideas?
Solution is to sett cookie to false:
// Create our Application instance.
$facebook = new Facebook(array(
‘appId’ => $fbconfig['appid'],
‘secret’ => $fbconfig['secret'],
‘cookie’ => false,
));
Hello!
I am the infinite loop error, my $session always returns an empty string. I have set all of the setting in my application to make the screenshot. I updated the Facebook lib to the 3/22/11 version. And I have tried disabling cookies when initialize the Facebook object.
Anything else to try?
http://bugs.developers.facebook.net/show_bug.cgi?id=15933
hope they will revise it soon…
thanks for all the great facebook tutorials, so much easier to understand compared to facebooks own documentation.
Will you be doing a tutorial on implementing facebook credits in an iframe app any time soon?
hello brother. i try to use ur facebook application demo http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development/
but when i try to make my own. i got the redirect problem.facebook page continuously refresh. sory to say am a noob in this field. can you tell me what the reall problem.
see my application and please tell me. http://apps.facebook.com/it-ilam/
email me. or reply here. am check this site every 1 hour. Thanx you very much.
Hello, remove all the extended permission from the login, and test what happens.
hi, my facebook application goes to infinite redirection, please help me resolve this.
This is my new app [just 1.5 months old], so i dont have those settings like your own in the image you provided !
So, what ever i can change, i changed, but the problem still exist !
http://apps.facebook.com/my_cartoon_face/
did you download the last version of PHP SDK ?
Yes, i’m using the latest PHP SDK
for me, I did the changes here described and updated the sdk, it worked and still working.
see if you are missing anything
I’m using PHP-SDK from this link
https://github.com/facebook/php-sdk/zipball/v2.1.2
and my sample code
$facebook = new Facebook(array(
‘appId’ => $fbconfig['appid'],
‘secret’ => $fbconfig['secret'],
‘cookie’ => true,
));
$session = $facebook->getSession();
$loginUrl = $facebook->getLoginUrl(
array(
‘canvas’ => 1,
‘fbconnect’ => 0,
‘req_perms’ => ‘read_stream,publish_stream,status_update,offline_access’
)
);
Perfect. Worked for me.
Thanks
Ahsan
Hi.
I have used SDK Facebook with Codeigniter. I tried to apply your fix, but it still do the infinit loop.
The code I have used is: https://bitbucket.org/deth4uall/facebook-ignited/overview
May you help me?
Hi,
Did you solved the looping problem @ SDK Facebook with Codeigniter
As CI removes value from $_GET so use the below code, hope it solves your problem.
public function __construct() { parent::__construct(); parse_str($_SERVER['QUERY_STRING'], $_GET); }I used your tutorial for SDK 2 and everything worked fine. Now I uploaded new SDK 3 and your new files iframe app. I cant fix this redirecting issue. I followed all of your steps, but still stuck. ur help will be appreciated.
thanks for this tutorial!
Did you check my latest post about SDK 3.0 ?
yes,..it’s slightly change…
hello,
i get login and logout problem ….
while login to my application and run code update status…it update user status…after click on logout i unable to logout even if i logout from my facebook account and login as different account then also it update status of first login user
plz help me….
i have taken code from ur tutorial
thanks in advance,
sanjay parate
I did as the tutorial said and it worked perfect for me
Thanks
Getting Error while loading page from App NAME Empty response received.ANY SOLUTION FOR THIS PROBLEM
hi, I wonder if you could help me, I am using php sdk 3.1.1 and after the user acept the permision to go to my app; the url the “next” parameter points to my domain instead of apps.facebook.com/appname, so the user goes do my page, instead of facebook iframe page.
any help would me appreciated.
Are you using facebook connect base site or iframe base canvas app ? You can also check this tutorial: http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development-php-sdk-3-0/
I just added this code to my index.php and it works.
if (isset($_GET['code'])) {
echo “top.location.href = ‘http://apps.facebook.com/appname’;”;
exit;
}
Thanks Mahmud, you’re a genius. I’ve lost 1 week to debug it until I find out your solution:D
youre great:D
Hey mate,
I have used your source files to see if I could replicate your test app, but it seems I am also stuck in the infinite loop.
I have updated to the latest fb sdk.
It worked fine initially but when I tested it from another facebook account it did not work.
hi,
i updated to latest version of sdk, but still the issue is there…
my scenario is i have a tab app and on authentication it goes into a infinite loop, can you confirm what should be the redirect uri value as i tried setting to the all canvas url, tab url and the url which is generated when clicking on the tab in the facebook.
overwrite latest sdk files. thats solved my loop error
Having this infinite loop problem, also. Thanks in advance for your help, Troy Cloudmit – Web Services Since 1999
Infinite loop problem. There’s a Fix?