开发者

How to disable logout on timeout with Authlogic?

开发者 https://www.devze.com 2023-01-16 07:58 出处:网络
I\'m running a Rails web app where the authentication system is based on Authlogic and tardate\'s authlogic_rpx.

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


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!


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

In the create action of the user_sessions_controller?

Or in the User model?

0

精彩评论

暂无评论...
验证码 换一张
取 消