You are here

protected function SessionLimit::_onSessionCollision__PreventNew in Session Limit 8

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

React to a session collision by preventing new sessions.

Parameters

SessionLimitCollisionEvent $event: The session collision event.

1 call to SessionLimit::_onSessionCollision__PreventNew()
SessionLimit::onSessionCollision in src/Services/SessionLimit.php
React to a collision event.

File

src/Services/SessionLimit.php, line 276

Class

SessionLimit

Namespace

Drupal\session_limit\Services

Code

protected function _onSessionCollision__PreventNew(SessionLimitCollisionEvent $event) {

  /** @var SessionLimitDisconnectEvent $disconnectEvent */
  $disconnectEvent = $this
    ->getEventDispatcher()
    ->dispatch('session_limit.disconnect', new SessionLimitDisconnectEvent($event
    ->getSessionId(), $event, $this
    ->getMessage($event
    ->getAccount())));
  if (!$disconnectEvent
    ->shouldPreventDisconnect()) {
    $this
      ->sessionActiveDisconnect($disconnectEvent
      ->getMessage());
  }
}