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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:21:49+00:00 2026-06-18T08:21:49+00:00

First, I’d like to say this isn’t a general question on the Facebook php/javascript

  • 0

First, I’d like to say this isn’t a general question on the Facebook php/javascript sdk. I’ve successfully added the “Facebook login button” to a few little test projects.

My question is, what is the best way to show the user is wanting to log in with Facebook. Just because someone is logged in to Facebook when the visit my site, doesn’t necessarily mean they want to login to my site with Facebook.

I know that after authorizing the user with a FB app, it redirects with a variety of $_GET variables, but if my user is returning to my site, and has already authorized my app, how can I create a “Facebook Login” button that basically ‘says’ If user clicks this button, pull Facebook user_profile, and use their info for login, else require Facebook login as normal.

I know I could create a button, forward to a page, set a session var, and redirect to the main page, but I’d like to create this effect without noticeable redirections; no redirections if possible.

  • 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-18T08:21:50+00:00Added an answer on June 18, 2026 at 8:21 am

    I think you want to use FB.getLoginStatus. You’ll asynchronously get a response telling you the auth state, and you can manually go from there (show their info, log them in, redirect if you want, etc).

    From the SDK reference (https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/):

    FB.getLoginStatus(function(response) {
      if (response.status === 'connected') {
        // the user is logged in and has authenticated your
        // app, and response.authResponse supplies
        // the user's ID, a valid access token, a signed
        // request, and the time the access token 
        // and signed request each expire
        var uid = response.authResponse.userID;
        var accessToken = response.authResponse.accessToken;
      } else if (response.status === 'not_authorized') {
        // the user is logged in to Facebook, 
        // but has not authenticated your app
      } else {
        // the user isn't logged in to Facebook.
      }
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all, this isn't for a keylogger, it's for an input in a
First question on SOF, please be gentle if this may be a stupid question.
First of all, I'm sorry about the feedback-nature of this question. I'm trying to
First, let me apologize if this is a repeat question. I did a search
First question from me, hope it's phrased correctly. I couldn't find anything on this
First things first, I'm aware of this question: Gearman: Sending data from a background
first take a look on this picture from localScope app : i have 2
first off I'm a noob to PHP but here is my problem. I am
first sorry if its a stupid question but im lost a bit. So when
First I want to say you that I'm totally new in Xcode so I'm

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.