Currently we have a site that uses basic site login using a username and password that is stored on the server. Our client wants to introduce Facebook login alongside the current site login.

Concerns are:

If a user already has a 'site' account then decides to signup with Facebook then we can match the two up if the email is the same (as would be the case in most scenarios) - The problem is introduced when the user has a different email for their Facebook account / site account. This would then leave the user with two accounts and could potentially lead to issues (users earn points for each purchase).

Has anyone had any experience with this and if so what are the pitfalls to avoid / best practice for dealing with this.

  • 8
    Give them an opportunity to link/merge both accounts. For example after signing in for the first time via face book. Or make something like "search for old account" for those "facebook" users that you couldn't automaticaly match. Commented May 11, 2012 at 9:26
  • 1
    As an example, rememberthemilk.com have provided an ability to associate a Google account with an existing website account so you can sign in with either account.
    – JonW
    Commented May 11, 2012 at 9:49
  • Thanks guys- this seems like the logical approach, it will be interesting to see the results. We will just have to make everything very clear for them. Commented May 11, 2012 at 10:30
  • yes i have faced an issue in similar way, we had to open both account for user to login and thus internally merging the same with system account. we have not got any problem as of now. I cannot post link as it am not allowed.
    – sree
    Commented May 11, 2012 at 13:59

2 Answers 2


We faced the same conundrum a year or so ago. This was my simple version of the Facebook Connect Login flows. The happy path in bold is for brand new members. What's not pictured, and is the crux of your question is at the bottom-right: when they log in, the system matches their login to their new FB userID key. [Note, the site we were working on is called Shoptopia.]

We created this flow before Facebook expanded the permissions they allow you to ask (email address, for one). So, were we to draft this today, we would tell users if we found an existing account to match up with, and if not, would ask them to also "log in" to match up accounts.

enter image description here


If you let the users who already have an account connect through Facebook, just merge the data. How does having a separate email affect that. Every user should have an ID in the database.

Make separate columns in the user table for Facebook: facebookemail, facebookid, etc..

Write a cookie to the browser with the user id and then when they connect through Facebook and come back to your site, save the facebook fields to the user table with the record that has the ID stored in the cookie.

The page that catches the user after the facebook connect can check to see if the user already has Facebook fields stored in their user table, if not, add the fields, if so, skip it and just log them in.

I guess at that point, the email doesn't really matter. You'll have two. I guess you can go a step further and display both emails and ask the user which one they want to use.

  • You have no way of matching one email to the other just by Facebook uid, because the fbuid is only tied to one email address. They would have to manually login after connecting, or connect after logging in to make the merge. Which is fine, but you need to name that step.
    – Taj Moore
    Commented May 15, 2012 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.