Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5939295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:48:28+00:00 2026-05-22T15:48:28+00:00

Something with echo $facebook->init(); is causing my site to refresh over and over again

  • 0

Something with “echo $facebook->init();” is causing my site to refresh over and over again in Chrome only. (Edit*: This also happens on my Android phone w/ Dolphin Browser.)

The code that calls this is:

echo $facebook-init();

and it generates this:

<div id="fb-root"></div><script type="text/javascript"> 
//<![CDATA[

          window.fbAsyncInit = function() {
            FB.init({
              appId   : '203899102970207',
              session : null, // don't refetch the session when PHP already has it
              status  : true, // check login status
              cookie  : true, // enable cookies to allow the server to access the session
              xfbml   : true // parse XFBML
            });
            // whenever the user logs in, we refresh the page
            FB.Event.subscribe('auth.login', function() {
              window.location.reload();
            });
          };
          (function() {
            var e = document.createElement('script');
            e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
            e.async = true;
            document.getElementById('fb-root').appendChild(e);
          }());

//]]>
</script>

Obviously I assume it’s the window.location.reload() that’s doing it, but – that’s not code I added or can edit manually.

Has anyone seen this or have any idea what could be causing it / how I can fix it?

Thanks in advance for any help / direction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:48:29+00:00Added an answer on May 22, 2026 at 3:48 pm

    In the lastest version of the CakePHP Facebook plugin, it allows you to pass false to the init() call which keeps it from refreshing over and over (or even once).

    This doesn’t seem like the best solution, because when a facebook user comes to the page, they won’t know they’re logged in until the next pageview, but – seems to be the only solution for now.

    $this->facebook->init(null, false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that looks like this #!/bin/bash function something() { echo hello
I have seen some code do this: if(something){ echo 'exit from program'; die; }
One of Googles Let's make the internet faster talks included something about using echo
I.e.: echo H#97llo | MagicPerlCommand Stdout: Hallo were MagicPerlCommand is something like perl -pnle
I'm using CodeIgniter (because it's awesome) and I have something like: <?php echo anchor(/,
Something like var life= { users : { guys : function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls
In bash I am able to write a script that contains something like this:
I want to echo something if the subdomain is not mobile and the file
Is it possible to echo a backspace in bash? Something like echo $'stack\b' Shouldn't
The actual code looks like this: if (file_exists($filename)) {echo $player; } else { echo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.