- /**
- * Logout another user sessions
- *
- * @return $this
- */
- public function logoutOtherUserSessions()
- {
- $collection = $this->createAdminSessionInfoCollection()
- ->filterByUser(
- $this->authSession->getUser()->getId(),
- \Magento\Security\Model\AdminSessionInfo::LOGGED_IN,
- $this->authSession->getSessionId()
- )
- ->filterExpiredSessions($this->securityConfig->getAdminSessionLifetime())
- ->loadData();
-
- $collection->setDataToAll('status', \Magento\Security\Model\AdminSessionInfo::LOGGED_OUT_MANUALLY)
- ->save();
-
- return $this;
- }