views:

1143

answers:

1

I do IFrame application for facebook.

Problem is: any link inside it causes redirect loop

Link is: http://mydomain/mypage?fb_sig=[what I got from $_GET['fb_sig']] (to test I link to the same page as my loaded canvas is loaded from)

when I click on it, my server returns:

<script type="text/javascript">
top.location.href = "http://www.facebook.com/login.php?api_key=5dc632fcef992470341178f492f79b93&amp;v=1.0&amp;next=http%3A%2F%2Fthiismydomain%2Ffacebook%2F%3Ffb_sig%3D96a5c47f133eadcfbba4abf82e5311e0%26page%3D1";
</script>

then it goes to corresponding page, and facebook returns

Location: http://thisismydomain/facebook/?fb_sig=96a5c47f133eadcfbba4abf82e5311e0&amp;page=1&amp;auth_token=ce4cf4968f91cace5b3e915f5b658984

then, my server replies with

<script type="text/javascript">
top.location.href = "http://www.facebook.com/login.php?api_key=5dc632fcef992470341178f492f79b93&amp;v=1.0&amp;next=http%3A%2F%2Fthisismydomain%2Ffacebook%2F%3Ffb_sig%3D96a5c47f133eadcfbba4abf82e5311e0%26page%3D1%26auth_token%3Dce4cf4968f91cace5b3e915f5b658984";
</script>

and back, facebook replies:

Location: http://thisismydomain/facebook/?fb_sig=96a5c47f133eadcfbba4abf82e5311e0&amp;page=1&amp;auth_token=ce4cf4968f91cace5b3e915f5b658984&amp;auth_token=77df653b7949ca39c1a226c82cce8add

and it goes on and one without end.

Should I say that this redirect responce from my server is generated automately (most probaby my facebook php lib)

I have no more ideas why this happends. Any ideas?

A: 

Hey! Stackoverflow really helps! After an hour after posting I found the answer myself!

Ok, if you recognize the problem, here is the solution:

fb_sig is not the only param to be passed manually. Whole fb_sig* should be passed. Read more at this beautiful page http://www.foobots.net/breakouts.html

I don't know who wrote this, but it made me absolutely happy after two days of headbreaking. Thank you man!

Sniff