Module: Breath::SessionsControllerHelper

Extended by:
ActiveSupport::Concern
Defined in:
lib/breath/controller/sessions_controller_helper.rb

Defined Under Namespace

Classes: InvalidPassword, InvalidPasswordConfirmation, TargetNotFound

Instance Method Summary collapse

Instance Method Details



51
52
53
54
55
56
57
58
59
# File 'lib/breath/controller/sessions_controller_helper.rb', line 51

def write_cookie(target_name, object)
  if Rails.application.config.respond_to? :breath_expires
    cookies.signed["#{target_name}_id".to_sym] = { value: object.id, expires: Rails.application.config.breath_expires }
    cookies[:remember_token] = { value: object.remember_token, expires: Rails.application.config.breath_expires }
  else
    cookies.permanent.signed["#{target_name}_id".to_sym] = object.id
    cookies.permanent[:remember_token] = object.remember_token
  end
end