diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-14 12:38:36 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-23 18:55:09 +0100 |
commit | 4264a9aac285fc31b354a74805c5bff72b517fb7 (patch) | |
tree | 20483ccac14d8cbf02d78e16bf59034c5c3f34af /perllib/Catalyst/Plugin/FixMyStreet/Session/StoreSessions.pm | |
parent | 910b1b8fef7e19b102459c97fc700a117d7a12aa (diff) |
Update last_active on login/logout/session expiry.
Diffstat (limited to 'perllib/Catalyst/Plugin/FixMyStreet/Session/StoreSessions.pm')
-rw-r--r-- | perllib/Catalyst/Plugin/FixMyStreet/Session/StoreSessions.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/perllib/Catalyst/Plugin/FixMyStreet/Session/StoreSessions.pm b/perllib/Catalyst/Plugin/FixMyStreet/Session/StoreSessions.pm index 5e7a3cede..30149fc2b 100644 --- a/perllib/Catalyst/Plugin/FixMyStreet/Session/StoreSessions.pm +++ b/perllib/Catalyst/Plugin/FixMyStreet/Session/StoreSessions.pm @@ -7,6 +7,7 @@ after set_authenticated => sub { my $sessions = $c->user->get_extra_metadata('sessions'); push @$sessions, $c->sessionid; $c->user->set_extra_metadata('sessions', $sessions); + $c->user->set_last_active; $c->user->update; }; @@ -16,6 +17,7 @@ before logout => sub { my $sessions = $user->get_extra_metadata('sessions'); $sessions = [ grep { $_ ne $c->sessionid } @$sessions ]; @$sessions ? $user->set_extra_metadata('sessions', $sessions) : $user->unset_extra_metadata('sessions'); + $user->set_last_active; $user->update; } }; |