I did a quick search and I didn't find any bug report about this issue.

I was testing the FB connect module on a site and I just realized that sometimes I was logged in with a random user when I try to log in with a facebook account, it just happens for a couple of FB accounts.

Looking at the code I found that sometimes the fbuid is longer that 10 chars, so it doesn't fit into a int variable in the DB.
What I did to fix the issue was to change in the DB the datatype for the 'fbuid' column on the 'fbconnect_users' table, and then I did the changes that you can see in the patch file.

I hope this can help someone.

CommentFileSizeAuthor
fbconnect.module.patch959 bytesleospataro

Comments

ha5bro’s picture

I was having the exact same problem on a contest website, glad that I'm not alone. I'd really like to see this issue get fixo.

(Personally) I'm not a fan of facebook, but it is undeniable that FBConnect is a great way to grow a website.

scottgifford’s picture

Same problem exists on 5.x. This is quite a big deal, since many newer Facebook UIDs are too big to fit into a 32-bit integer.

BIGINT might be a better SQL column type to use. That should accommodate all Facebook UIDs without requiring any code changes.

rf-pldev’s picture

I believe this issue has been brought up before, I can't remember if it was here or re the Facebook module. In any case, FB has been recommending BIGINT for a while (at least a year), ever since they announced the larger user IDs:

"The user ID is a 64-bit int datatype. If you're storing it in a MySQL database, use the BIGINT unsigned datatype."
http://wiki.developers.facebook.com/index.php/User_ID

take note of unsigned

scottgifford’s picture

Thanks, I was just in the process of not taking into account unsigned. :-)

Since Postgres doesn't support an unsigned bigint, I guess I'll be using a string after all.

Thanks!

leospataro’s picture

Guys, keep in mind that you will have to change the db query to support larger int values, %d on the query won't work

vectoroc’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.