Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authlogic automatic logout on timeout

I am using the Authlogic gem in my application, and I need users to be logged out automatically after 15 minutes of inactivity. Can somebody tell me how to do this?

like image 332
el_quick Avatar asked Mar 10 '26 04:03

el_quick


1 Answers

On User model:

acts_as_authentic do |c|
  c.logged_in_timeout(5.minutes)
end

on UserSession model:

self.logout_on_timeout = true
like image 78
el_quick Avatar answered Mar 11 '26 21:03

el_quick