You are here

protected function SessionLimit::_onSessionCollision__PreventNew in Session Limit 2.x

Same name and namespace in other branches
  1. 8 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 293

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