Question

I am implementing devise user authentication on a Rails 4 App and was wondering how do I stop the App from logging the User out after a certain amount of time. I want a user not to be signed out unless they click the sign out button, I believe this is called permanent login.

Was it helpful?

Solution

If you look inside config/initializers/devise.rb you will find configuration settings that include config.timeout_in.

It is also possible to set it within the model:

class User < ActiveRecord::Base
  devise :timeoutable, timeout_in: 15.minutes
end

Check this link for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top