fnllc
fnllc

Reputation: 3127

What is the devise config.remember_for default value?

I have the following in my devise.rb initializer:

  # ==> Configuration for :rememberable
  # The time the user will be remembered without asking for credentials again.
  # config.remember_for = 2.weeks

What is the default used by devise when commented out? It is not specified for this setting. Is it 2.weeks or infinite? I'm finding contradictory information in the documentation. I'm on Devise 3.5.10.

Upvotes: 2

Views: 1492

Answers (1)

omnikron
omnikron

Reputation: 2321

Looking at the gem's code directly you can find that it defaults to 2 weeks. For example here in a comment:

#   * +remember_for+: the time you want the user will be remembered without
    #     asking for credentials. After this time the user will be blocked and
    #     will have to enter their credentials again. This configuration is also
    #     used to calculate the expires time for the cookie created to remember
    #     the user. By default remember_for is 2.weeks.

or here where it is actually set:

mattr_accessor :remember_for
@@remember_for = 2.weeks

Upvotes: 2

Related Questions