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 8091717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:07:38+00:00 2026-06-05T20:07:38+00:00

I wondered if anyone has found a workaround to the behaviour that I’m experiencing.

  • 0

I wondered if anyone has found a workaround to the behaviour that I’m experiencing.

Take the example of the below code:

<script>
window.fbAsyncInit = function() {
        FB.init({
          appId      : '[----removed-------]', // App ID
          channelUrl : 'http://localhost/channel.html', // Channel File
          status     : true, // check login status
          cookie     : true, // enable cookies
          xfbml      : true  // parse XFBML
        });     
        // Additional initialization code here

        FB.Event.subscribe('auth.statusChange',fbLoginStatus);

        console.log("getloginstatus");

        FB.getLoginStatus(fbLoginStatus);
</script>

Using FB.init with status set to true, essentially calls getLoginStatus() according to the facebook documentation. However, it is apparently intended behaviour that this will not trigger the event auth.statusChange, because the default value is ‘unknown’, and the value for ‘not logged in’ is also ‘unknown’ (even though it can be known!!)

Therefore I have had to make a call to FB.getLoginStatus() explicitly as well as having the status set to true if I want to also respond to users who are not logged in to facebook.

The problem is, this results in the function being called twice if the user is anything other than “logged out”.

Is there a neat way to stop this happening?
I think my only option might be to call a different function to handle auth change events..

  • 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-05T20:07:39+00:00Added an answer on June 5, 2026 at 8:07 pm

    My best solution for this was to set status to ‘false’ in the fb.init options, then to explicitly call getloginstatus separately.

    IF get loginstatus came back as unknown (i.e. logged out), I subscribed to the status change event, as well as doing the usual of displaying the login button. Then when the user logs in, status change fires as expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I've found a bug in safari. I wondered if anyone has encountered
I want to trial Windows 7 but wondered if anyone who has done so
Has anyone ever wondered where VisualStudio stores the states of regions in the source
I've never really considered this question before and wondered if anyone has any advice
Has anyone come across an example of a non .Net consumer of an ADO.NET
I wondered if anyone could shed some light on the way in which layers
I'm having the following problem and wondered whether anyone could see why this is
I'm learning about composite UIs at the moment and I wondered if anyone could
I'm thinking of writing a new web-based game, and wondered if anyone had any
I'm developing a Django-based site for fun, and wondered if anyone knows how to

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.