Module: Devise::Controllers::Rememberable
- Included in:
- Proxy
- Defined in:
- lib/devise/controllers/rememberable.rb
Overview
A module that may be optionally included in a controller in order to provide remember me behavior.
Defined Under Namespace
Classes: Proxy
Class Method Summary collapse
-
.cookie_values ⇒ Object
Return default cookie values retrieved from session options.
Instance Method Summary collapse
-
#forget_me(resource) ⇒ Object
Forgets the given resource by deleting a cookie.
-
#remember_me(resource) ⇒ Object
Remembers the given resource by setting up a cookie.
Class Method Details
.cookie_values ⇒ Object
Return default cookie values retrieved from session options.
7 8 9 |
# File 'lib/devise/controllers/rememberable.rb', line 7 def self. Rails.configuration..slice(:path, :domain, :secure) end |
Instance Method Details
#forget_me(resource) ⇒ Object
Forgets the given resource by deleting a cookie
30 31 32 33 34 |
# File 'lib/devise/controllers/rememberable.rb', line 30 def forget_me(resource) scope = Devise::Mapping.find_scope!(resource) resource.forget_me! .delete("remember_#{scope}_token", (resource)) end |
#remember_me(resource) ⇒ Object
Remembers the given resource by setting up a cookie
23 24 25 26 27 |
# File 'lib/devise/controllers/rememberable.rb', line 23 def remember_me(resource) scope = Devise::Mapping.find_scope!(resource) resource.remember_me!(resource.extend_remember_period) .signed["remember_#{scope}_token"] = (resource) end |