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

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

Instance Method Summary collapse

Instance Method Details

#forget_me!Object

Clears the cookie and clears the token from the db.



23
24
25
26
# File 'lib/sorcery/controller/submodules/remember_me.rb', line 23

def forget_me!
  current_user.forget_me!
  cookies[:remember_me_token] = nil
end

#remember_me!Object

This method sets the cookie and calls the user to save the token and the expiration to db.



17
18
19
20
# File 'lib/sorcery/controller/submodules/remember_me.rb', line 17

def remember_me!
  current_user.remember_me!
  cookies[:remember_me_token] = { :value => current_user.remember_me_token, :expires => current_user.remember_me_token_expires_at }        
end