Module: Sorcery::Controller::Submodules::RememberMe

Defined in:
lib/sorcery/controller/submodules/remember_me.rb

Overview

The Remember Me submodule takes care of setting the user’s cookie so that he will be automatically logged in to the site on every visit, until the cookie expires. See Sorcery::Model::Submodules::RememberMe for configuration options.

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/sorcery/controller/submodules/remember_me.rb', line 9

def self.included(base)
  base.send(:include, InstanceMethods)
  Config.module_eval do
    class << self
      attr_accessor :remember_me_httponly
      def merge_remember_me_defaults!
        @defaults.merge!(:@remember_me_httponly => true)
      end
    end
    merge_remember_me_defaults!
  end
  Config. << :login_from_cookie
  Config. << :remember_me_if_asked_to
  Config.after_logout << :forget_me!
end