Webeks.net - freelance programming
freelance programming - php, Joomla, Zend ...
Home :: Articles :: Programming :: Facebook :: Facebook IFrame and Ajax require_login()

Facebook IFrame and Ajax require_login()

Written by Miha

Another day another bug (or just weird behavior) in Facebook platform.

When calling $facebook->require_login() from anywhere else then a canvas page it is caught in an endless loop.

I was going crazy over this for few days. The big problem was that conditions under which this error occurs distinguish between IE and FireFox.

In short - the solution is ... you have to carry Facebook signature variables (stored in $_GET) with you all the time.

  1. $fbsig_vars = "";
  2. $i=0;
  3. foreach($_GET as $key => $value) {
  4. if (strpos($key,"fb_sig")!==false) {
  5. if ($i!=0) $fbsig_vars.= "&";
  6. $fbsig_vars.= "$key=$value";
  7. $i=1;
  8. }
  9. }

 

 


blog comments powered by Disqus