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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:49:42+00:00 2026-05-16T15:49:42+00:00

I am integrating facebook connect with my application which uses authlogic, facebooker, and the

  • 0

I am integrating facebook connect with my application which uses authlogic, facebooker, and the authlogic_facebook_connect plugin. After I log in with facebook, I get redirected to the front page of the site (as per my code) – but the page never loads! – it hangs.
Looking at the development log, I see that something is continuously trying to load a user from the database.

It just keeps going on and on and every time I reload development.log (while the page is still trying to load) it just gets bigger – development log on bottom.

Here’s the info I got:

  1. Doing some debugging, I traced the issue to the function meant to persist a user session with authlogic (no params):

    UserSession.find

  2. Looks like Authlogic is trying to find a user in the database with a certain persistence_token. Looking directly at that record through the console – its persistence token is null (that could be just because the next thing a properly functioning authlogic would do is to set that persistence_token – not sure though).

Can anybody give me any pointers?

Thanks!


[4;36;1mUser Load (0.7ms)[0m   [0;1mSELECT * FROM "users" WHERE ("users"."id" = '4') LIMIT 1[0m
[4;35;1mUser Load (0.6ms)[0m   [0mSELECT * FROM "users" WHERE ("users"."facebook_uid" = 100001121293021) LIMIT 1[0m
[4;36;1mUser Load (0.2ms)[0m   [0;1mSELECT "users".id FROM "users" WHERE ("users"."persistence_token" = 'ddd6b0d160321e55266db847d0b4558e9ed76ab220ef3fce655c24c5d24286d56d728deda76b44741121b0b78e1c266537fbfe00bf01206a393090c5c1f475' AND "users".id <> 4) LIMIT 1[0m
[4;35;1mCACHE (0.0ms)[0m   [0mSELECT * FROM "users" WHERE ("users"."id" = '4') LIMIT 1[0m
[4;36;1mCACHE (0.0ms)[0m   [0;1mSELECT * FROM "users" WHERE ("users"."facebook_uid" = 100001121293021) LIMIT 1[0m
[4;35;1mCACHE (0.0ms)[0m   [0mSELECT "users".id FROM "users" WHERE ("users"."persistence_token" = 'ddd6b0d160321e55266db847d0b4558e9ed76ab220ef3fce655c24c5d24286d56d728deda76b44741121b0b78e1c266537fbfe00bf01206a393090c5c1f475' AND "users".id <> 4) LIMIT 1[0m
[4;36;1mCACHE (0.0ms)[0m   [0;1mSELECT * FROM "users" WHERE ("users"."id" = '4') LIMIT 1[0m
[4;35;1mCACHE (0.0ms)[0m   [0mSELECT * FROM "users" WHERE ("users"."facebook_uid" = 100001121293021) LIMIT 1[0m
[4;36;1mCACHE (0.0ms)[0m   [0;1mSELECT "users".id FROM "users" WHERE ("users"."persistence_token" = 'ddd6b0d160321e55266db847d0b4558e9ed76ab220ef3fce655c24c5d24286d56d728deda76b44741121b0b78e1c266537fbfe00bf01206a393090c5c1f475' AND "users".id <> 4) LIMIT 1[0m
[4;35;1mCACHE (0.0ms)[0m   [0mSELECT * FROM "users" WHERE ("users"."id" = '4') LIMIT 1[0m
[4;36;1mCACHE (0.0ms)[0m   [0;1mSELECT * FROM "users" WHERE ("users"."facebook_uid" = 100001121293021) LIMIT 1[0m
[4;35;1mCACHE (0.0ms)[0m   [0mSELECT "users".id FROM "users" WHERE ("users"."persistence_token" = 'ddd6b0d160321e55266db847d0b4558e9ed76ab220ef3fce655c24c5d24286d56d728deda76b44741121b0b78e1c266537fbfe00bf01206a393090c5c1f475' AND "users".id <> 4) LIMIT 1[0m
[4;36;1mCACHE (0.0ms)[0m   [0;1mSELECT * FROM "users" WHERE ("users"."id" = '4') LIMIT 1[0m
[4;35;1mCACHE (0.0ms)[0m   [0mSELECT * FROM "users" WHERE ("users"."facebook_uid" = 100001121293021) LIMIT 1[0m
[4;36;1mCACHE (0.0ms)[0m   [0;1mSELECT "users".id FROM "users" WHERE ("users"."persistence_token" = 'ddd6b0d160321e55266db847d0b4558e9ed76ab220ef3fce655c24c5d24286d56d728deda76b44741121b0b78e1c266537fbfe00bf01206a393090c5c1f475' AND "users".id <> 4) LIMIT 1[0m
[4;35;1mCACHE (0.0ms)[0m   [0mSELECT * FROM "users" WHERE ("users"."id" = '4') LIMIT 1[0m
[4;36;1mCACHE (0.0ms)[0m   [0;1mSELECT * FROM "users" WHERE ("users"."facebook_uid" = 100001121293021) LIMIT 1[0m
[4;35;1mCACHE (0.0ms)[0m   [0mSELECT "users".id FROM "users" WHERE ("users"."persistence_token" = 'ddd6b0d160321e55266db847d0b4558e9ed76ab220ef3fce655c24c5d24286d56d728deda76b44741121b0b78e1c266537fbfe00bf01206a393090c5c1f475' AND "users".id <> 4) LIMIT 1[0m
  • 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-16T15:49:43+00:00Added an answer on May 16, 2026 at 3:49 pm

    Got it!
    In normal user registration with authlogic, here’s what happens:
    before_validation :reset_persistence_token, :if => :reset_persistence_token?
    What this does, is set an initial persistence_token if it is blank

    For some reason, the authlogic_facebook_connect plugin skips this validation, causing a NULL persistence_token field to be sent to the database.

    In my users table, I had the field persistence_token as such

    t.string :persistence_token
    

    it should be defined like that, but making sure that it’s not null:

    t.string :persistence_token, :null => false
    

    Now, instead of hanging the browser, you get a sqlite error saying that persistence token is null. That’s better, now we know what’s going on.

    Going to the validate_by_facebook_connect method of the authlogic_facebook_connect plugin located inside vendor/plugins/authlogic_facebook_connect/lib/authlogic_facebook_connect/session.rb, where it says

    new_user.send(:"#{facebook_uid_field}=", facebook_session.user.uid)
    new_user.send(:"#{facebook_session_key_field}=", facebook_session.session_key)
    

    add another line, so it reads:

    new_user.send(:"#{facebook_uid_field}=", facebook_session.user.uid)
    new_user.send(:"#{facebook_session_key_field}=", facebook_session.session_key)
    new_user.reset_persistence_token
    

    now we make sure we have a persistence token set when we first create the user.
    do it again, browser doesn’t hang, user gets created, welcome to a working authlogic facebook connect setup.

    Even though I included the fix in the authlogic_facebook_connect plugin, this is really an authlogic issue.


    EDIT:

    1. I submitted a ticket to the
      authlogic github page about
      this issue
    2. I wrote a blog post about this issue to help others that get stuck with it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently integrating Facebook Connect with my application which has an existing users table.
I'm following the tutorial here http://applicake.com/posts/54-integrating-facebook-connect-with-rails-applications to set up facebook connect. It almost worked,
I am developing an Android application. Here I'm integrating the facebook api to my
I have successfully wired up a Facebook Connect application and everything is working fine.
Integrating FB Connect into our site using Rails 2.2.2 and Facebooker gem (latest version).
I am integrating in my application a sign on using facebook and twitter. I
I am using facebook sdk and facebook connect for integrating fb into my site
I'm working on integrating Facebook with my iPhone/iOS application and I want to know
i am integrating facebook with my iphone application. i can share text message in
I'm integrating a Flash-free web site with Facebook Connect. Loading it in Internet Explorer

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.