How to disable logout on timeout with Authlogic?

834 views Asked by At

I'm running a Rails web app where the authentication system is based on Authlogic and tardate's authlogic_rpx.

The first one handles everything about sessions, the second one does the mapping with RPX/Janrain (which offers the users to sign in with Twitter or Facebook).

All the users are always automatically logged out after a certain inactivity time (I never managed to know how long), though I disabled the automatic logout and even set up the logout time to 1.year as explained in Authlogic documentation.

What should I do to keep my users logged in?

Kevin

2

There are 2 answers

0
martini-bonanza On BEST ANSWER

I finally fixed it. It's written in the documentation that the remember_me parameter will do it:

UserSession.create(:login => "bjohnson", :password => "my password", :remember_me => true)

Unfortunately, it's not working, so I had to add this line below:

UserSession.remember_me = true

…and the magic cookie is finally created!

0
Galen On

Where did you place the line (UserSession.remember_me = true)?

In the create action of the user_sessions_controller?

Or in the User model?