You are here

public function SessionLimit::sessionActiveDisconnect in Session Limit 8

Same name and namespace in other branches
  1. 2.x 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 362

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());
}