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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:56:31+00:00 2026-05-26T21:56:31+00:00

I am thinking of tying in a Facebook JavaScript-based application with an existing website

  • 0

I am thinking of tying in a Facebook JavaScript-based application with an existing website that has it’s own user accounts, but have a question about a specific user situation.

The website is run almost 100% of the time from ‘shared’ computers, like those found in a career center. User A comes to my website, signs into the site and then authorizes the Facebook app, which stores their session in the browser, along with, effectively, signing them into Facebook.com.

User A now leaves my application by signing out of my site – but not closing the browser.

User B arrives, logs into my site with their login, but the Facebook session is still active (due to the browser staying open), so any FB app integrations I’ve included will show as if it is still user A, correct?

So the question is, what are the recommended ways to deal with this? Two options come to mind:

  1. When the user signs out of my website, I fire an FB.logout call, so that all of the sessions are killed. Pros – I can ensure that user’s signing into the site will not have old sessions hanging around. Cons – a user who is returning shortly after leaving will have to re-login to FB as well as my site to see the FB integrations – I’d love to avoid the user ALWAYS having to do two logins. Secondly, forcing the FB.logout when they leave my site kills any active sessions they have at facebook.com, which makes for a bad user experience as they would not ‘get’ why logging out of my site has anything to do with facebook.com, and will then have to re-signin to facebook.com.

  2. The second option would be that when the user authorizes the FB app, I take their member ID and store that locally and persistently (database). Then, when a user returns to the site and signs in, I check their FB auth status, and if logged in to FB, pull their member ID and check it against the one I have stored locally. If they match, I have the correct user, if not, I do FB.logout and have them sign in to FB. Pros – this should ensure I always have the correct user to the site. Cons – not sure if getting, storing the member ID is feasible.

Any suggestions or pointers to the ‘best practice’ when it comes to ensuring that the current user is indeed the one associated with the FB account, specifically in this ‘shared computing’ situation where sessions may overlap?

Thanks

  • 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-26T21:56:32+00:00Added an answer on May 26, 2026 at 9:56 pm

    The second option looks to me to be the better choice. You can indeed store the users facebook id. By storing it locally i’m assuming you are talking using a cookie; however storing in a database is just as feasible.

    Facebook user id’s should be stored with a BIGINT(20) data type – such are the recommendations from facebook.

    Taken from the user section of the facebook api refrence :

    Looks like they changed their recomendations…

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

Sidebar

Related Questions

I'm trying to design an interface for a web-based application that allows the user
I have an IEnumerable full of objects that we are using to represent user
I've been trying to add Facebook Connect to a website, but it didn't seem
I am using Ruby on Rails 3 and I have a monolithic application that
Suppose that we have a web site where each person has a profile and
I have been thinking of trying out component based architecture for game development. I
For a new application based on Erlang, Python, we are thinking of trying out
I have currently created a facebook like page that pulls notifications from different tables,
I'm trying to get Thinking Sphinx running on my site but I'm not sure
I'm trying to implement thinking-sphinx across multiple 'sites' hosted under a single rails application.

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.