activeSessionResource = $activeSessionResource; $this->authSession = $authSession; $this->logger = $logger; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetCurrentSession( AdminSessionsManager $subject, AdminSessionInfo $result ): AdminSessionInfo { if (!$this->isValid) { $adminSessionInfoId = (int)$result->getId(); if (!empty($this->authSession->getSessionId()) && $adminSessionInfoId && ($user = $this->authSession->getUser()) ) { $userId = (int)$user->getId(); try { $this->activeSessionResource->updateIfSessionInvalid($userId, $adminSessionInfoId); } catch (\Exception $e) { $this->logger->critical($e); } } $this->isValid = true; } return $result; } }