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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:12:59+00:00 2026-05-30T23:12:59+00:00

Probably a dumb thing to ask, but this will really help me get my

  • 0

Probably a dumb thing to ask, but this will really help me get my head around FB integration.

I am using standard FB.init to use javascript SDK, and using PHP SDK to do some basic API calls:

    FB.init({
  appId      : '265236093556723', // App ID
  status     : true, // check login status
 // cookie     : true, // enable cookies to allow the server to access the session. WHY IS THERE AN INFINITE LOOP WHEN THIS IS REMOVED?!?!?!?!?!
  xfbml      : true,  // parse XFBML
  oauth      : true,
  channelUrl : 'http://www.loveweber.co.uk/dev/fbchannel.php' // Channel File

});

I was testing stuff and commented out the cookie: true line. This caused the site to loop through realoding the page and im not sure why. I read everywhere that PHP uses this cookie set by Javascript… so is it something to do with the PHP call to the API?

Or maybe something to do with:

        FB.Event.subscribe('auth.login', function(response) {
        window.location.reload(); // When user logs in, the page refreshes...
        });
    FB.Event.subscribe('auth.logout', function(response) {
          window.location.reload();
        });

the realoding of the page when a user logs in or out?

Thanks would help such a lot.

  • 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-30T23:13:01+00:00Added an answer on May 30, 2026 at 11:13 pm
    FB.Event.subscribe('auth.login', function(response) {
        window.location.reload(); // When user logs in, the page refreshes...
    });
    FB.Event.subscribe('auth.logout', function(response) {
          window.location.reload();
    });
    

    I notice that your not checking the response variable in either event subscription. You should ensure that the response is what you think it is before you blindly do the reload(); The reason Facebook sends you the response object is because it is not always what you think.

    The response object will be like:

         {
           status: "xxx",         /* Current status of the session */
           authResponse: {          /* Information about the current session */
              userID: ""          /* String representing the current user's ID */
              signedRequest: "",  /* String with the current signedRequest */
              expiresIn: "",      /* UNIX time when the session expires */
              accessToken: "",    /* Access token of the user */
           }
         }
    

    So be sure the response.status is ‘connected’ when you subscribe to auth.login. and then not ‘connected’ when you subscribe to the auth.logout.

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

Sidebar

Related Questions

This is probably a really dumb question with a simple answer but... I am
This will probably sound dumb, but I need to execute a C# code from
This is probably a really dumb question, but I'm finding conflicting information. I have
This is probably a really dumb question, but it's virtually impossible to google the
This is probably a dumb question but I'm going to ask it anyways... I
Probably a dumb question, but is it still using Include files?
Okay this is probably a really dumb question, however it's really starting to hurt.
This is going to be a really dumb question, I just know it, but
I feel really dumb for asking this question, but here it goes. I have
I'm very new to Java programming language so this is probably dumb question but

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.