ruby-on-railsdevise

Can you use Devise :timeoutable and :rememberable at the same time?


And if so, how are they different that that is possible?

And if not, why do both exist? Why not have one without the other? If you don't have :timeoutable, then the session is automatically remembered. If you don't have :rememberable, then the session automatically times out.

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

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


Solution

  • Timeout:

    Remember Me:

    Both in place:

    If both timeout and rememberable is enabled in your application then rememberable overwrites the timeout flow.

    Here, you can see that sign_out happens after timeout only when proxy.remember_me_is_active?(record) is not true.