You are here

public function SessionLimit::sessionActiveDisconnect in Session Limit 2.x

Same name and namespace in other branches
  1. 8 src/Services/SessionLimit.php \Drupal\session_limit\Services\SessionLimit::sessionActiveDisconnect()

Disconnect the active session.

This is called when the user is prevented from logging in due to an existing open session.

Parameters

string $message:

1 call to SessionLimit::sessionActiveDisconnect()
SessionLimit::_onSessionCollision__PreventNew in src/Services/SessionLimit.php
React to a session collision by preventing new sessions.

File

src/Services/SessionLimit.php, line 379

Class

SessionLimit

Namespace

Drupal\session_limit\Services

Code

public function sessionActiveDisconnect($message) {
  $this->messenger
    ->addMessage($message, $this
    ->getMessageSeverity());
  $this->moduleHandler
    ->invokeAll('user_logout', array(
    $this->currentUser,
  ));
  $this->sessionManager
    ->destroy();
  $this->currentUser
    ->setAccount(new AnonymousUserSession());
}