Class: SessionsController

Inherits:
Devise::SessionsController
  • Object
show all
Defined in:
app/controllers/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

In order to automatically remember users in devise, i.e. without having to check the “remember me” checkbox, we override the setting here.

stackoverflow.com/questions/14417201/how-to-automatically-keep-user-remembered-in-devise

Furthermore, this registers the session with the metric service in order to track the users’ activities.



11
12
13
14
# File 'app/controllers/sessions_controller.rb', line 11

def create
  super
  metric_logger.register_session
end

#destroyObject



16
17
18
19
# File 'app/controllers/sessions_controller.rb', line 16

def destroy
  current_user.update_last_seen_activity(nil) if current_user
  super
end