Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

devise config.timeout_in not working

I am unable to timeout session with devise session timeout in initializers/devise.rb

I set

config.timeout_in = 1.minute

in initializers/devise.rb and i signin with one user and stayed idle for 2 minutes. This is suppose to invalidate current session and again prompt to ask for user credentials but the session never dies.

Am i doing something wrong or missing anything?

Thanks

like image 541
Gagan Avatar asked Mar 03 '11 17:03

Gagan


2 Answers

The timeout_in and remember_me will not work together.

Timeoutable incompatible with the remember_me checkbox. You can have one, but not both.

like image 197
Sartaj Singh Sisodiya Avatar answered Oct 19 '22 23:10

Sartaj Singh Sisodiya


You need to include :timeoutable in your Model, i.e.

devise :timeoutable

http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Timeoutable

like image 26
sumskyi Avatar answered Oct 19 '22 23:10

sumskyi