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

  • SEARCH
  • Home
  • 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 9130293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:56:22+00:00 2026-06-17T07:56:22+00:00

for some reason today my code for auto login for existed members broke. normally

  • 0

for some reason today my code for auto login for existed members broke.
normally this code works perfect, after a check with firebug I saw that there is a problem finding ‘auth.login’ for some reason, and therefor the call for window.location.reload(); isn’t working. (if I refresh manually then the member shows as connect properly,the problem is just the auto login before the session is open that need a page refresh)
I also tried to see if the problem is only ‘auto.login’ and replaced it with ‘auth.authResponseChange’ when I did it the page kept on refreshing … so I figure that problem is with ‘auth.login’ trigger.
does anyone knows for a special reason or any change facebook made that could cause this problem?

*update* BUG is solved! this problem was fixed by facebook.

this bug was reported and also answered by facebook here-

https://developers.facebook.com/bugs/524245490930206?browse=search_50f87d9e8869a5e06191882#

BTW,Here is A WORKING AGAIN code:

<div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({
              appId  : '<?php =$APP_ID ?>',
              status : true, // check login status
              cookie : true, // enable cookies to allow the server to access the session
              xfbml  : true,  // parse XFBML
              oauth  : true
        });

      // Additional initialization code here
        FB.Event.subscribe('auth.login', function(response) {
          window.location.reload();
        });
      };
      // Load the SDK Asynchronously
      (function(d){
         var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
         if (d.getElementById(id)) {return;}
         js = d.createElement('script'); js.id = id; js.async = true;
         js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
         ref.parentNode.insertBefore(js, ref);
       }(document));
    </script>
  • 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-06-17T07:56:22+00:00Added an answer on June 17, 2026 at 7:56 am

    it seems i’m experiencing the same problem ..

    Till a few hours ago, when a user (who had already authorized and logged in to my app previously) opened my website and the cookie was expired, the login button appeared but after a few seconds (the time for the JS SDK to trigger the login function), he was automatically logged-in and the page was reloaded without the login button and with the user information.

    Now when an already registered user opens my site after cookie expired, the login button appears again, but the user isn’t automatically logged in and the page doesn’t reload like it did before. The strange thing is that if i click on the login button it doesn’t work either! If i now refresh the page manually the login button disappears and user information is displayed, so it seems that the user was actually logged-in but the event was not caught to trigger the page reload.

    If i manually log-out and login again (thus using the php sdk) everything works.

    My code:

    <script>
            window.fbAsyncInit = function() {
                FB.init({
                    appId: '<?php echo $facebook->getAppID() ?>',
                    cookie: true,
                    xfbml: true,
                    oauth: true
                });
                FB.Event.subscribe('auth.login', function(response) {
                    window.location.reload();
                });
                FB.Event.subscribe('auth.logout', function(response) {
                    window.location.reload();
                    });
            };
            (function() {
                var e = document.createElement('script'); e.async = true;
                e.src = document.location.protocol +
                    '//connect.facebook.net/en_US/all.js';
                    document.getElementById('fb-root').appendChild(e);
            }());
            function facebookLogin() {
                FB.login(function(response) {
                    // handle the response
                }, {scope: 'email, publish_stream, read_friendlists'});
            }
        </script>
    

    UPDATE I added this few lines to my js code:

    FB.Event.subscribe('auth.statusChange', function(response) {
                    alert('The status of the session is: ' + response.status);
                });
    

    So now when the users opens my page after token expired:

    • the php sdk detects he’s not logged in and displays the login dialog
      (like before)
    • the javascript sdk triggers the login functions (like
      before)
    • the user gets regularly logged (in like before) (i can know
      it for sure now because it pops up the alert: The status of the
      session is:connected)
    • BUT.. the event auth.login is not triggered ->
      the script isn’t aware of succeeded log in -> the page is not
      reloaded
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

An easy problem, but for some reason I just can't figure this out today.
For some reason, this line of code is returning undefined for $(this).attr(href) $(a).attr(href, javascript:page('
I am using Visual studio 2008 and for some reason when I started today
For some reason there's a variable called d that is defined immediately after I
For some reason this isn't working, am I missing something obvious? RewriteRule ^(.*)infopopup.html$ /acatalog/infopopup.html
I am having trouble with the most simple piece of code. For some reason,
Well I guess this has been asked a thousand times, but for some reason
I'm probably doing something stupid, but I can't think today for some reason. I
Also for some reason it was working yesterday but it isn't working today. I
Is there any convention how to name parameters in JPQL ?Because today after some

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.