How to configure time out using devise?

devise, ruby-on-rails

Solution

Are you expecting the page to refresh and show you a login page again? If so, that's not how the timeoutable feature works. If you're expecting it to present you with the login page when you refresh, remove the timeout part from your model and put the following in devise.rb NOT development.rb. Don't forget to restart rails server.

config.timeout_in = 1.hour

This is all documented in the devise wiki here

Also, I'm not sure about the logic behind 10 seconds?? Seems a little too short. If it's still not working, increase to (for example) five minutes and test.

Problem

Model: ``` devise :database_authenticatable, :registerable,:timeoutable, :recoverable, :rememberable, :trackable, :validatable,:timeout_in => 10.seconds ``` development.rb: ``` config.timeout_in = 10.seconds ``` devise.rb: ``` config.timeout_in = 10.seconds ```

Original source