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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:02:32+00:00 2026-05-24T06:02:32+00:00

I am working an a test page to get the Facebook login button functionality

  • 0

I am working an a test page to get the Facebook login button functionality correct.

I got the FB button to work correctly when the person logs in and logs out of FB. But I am not sure how to get my sites’ header to update to toggle the login/logout link.

After the FB loging/logout I update the site’s session with all the same data as I would during regular login/logout, but for some reason the header does not update there.

Any idea how to fix it? FYI I am testing this stuff out here: http://www.comehike.com/test_fb_connect.php

  • 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-24T06:02:34+00:00Added an answer on May 24, 2026 at 6:02 am

    Well, for that you would have to use Facebook’s Javascript API to detect when the user has logged in or logged out, and then do an AJAX request for updating your header. This would be done through FB.Event.subscribe, as the following snippet points out:

    window.fbAsyncInit = function() {
        FB.init({
            appId  : 'YOURAPPID',
            status : true, // check login status
            cookie : true, // enable cookies to allow the server to access the session
            xfbml  : true,  // parse XFBML
            channelUrl  : 'http://www.yourdomain.com/channel.html', // Custom Channel URL
            oauth : true //enables OAuth 2.0
        });
    
        // retrieve the login status.
        FB.getLoginStatus(function(response) {
            if (response.authResponse) update_user_is_connected();
            else update_user_is_not_connected();
        });
    
        // This will be triggered as soon as the user logs into Facebook (through your site)
        FB.Event.subscribe('auth.login', function(response) {
            // Here you would update your header.
            update_user_is_connected();
        });
    };
    

    You can read more about FB.Event.subscribe here: http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

    Please note this code is taken from previous answers of mine.

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

Sidebar

Related Questions

I'm working on a page on which I'm dynamically creating a Facebook Like button
I've got 256 colors working great in my terminal ( test scripts here ),
Im working on a HTML test page with a simple grid that has red
I'm trying to get this code working within an asp page. when the user
I made a small example HTML page to get JQuery's getJSON method working. It
I'm trying to get a website working on my test environment, but somehow it
I recently forked https://github.com/fortuity/rails3-mongoid-omniauth and tried to get login working for different providers. It
I have the jquery autocomplete example working on a test page, but can't seem
Working with Test::Unit and Shoulda. Trying to test Users.create . My understanding is that
I'm working on a test framework in Perl. As part of the tests, I

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.