You are here

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

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

React to a collision event.

The user has more sessions than they are allowed. Depending on the configured behaviour of the module we will either drop existing sessions, prevent this new session or ask the user what to do.

Parameters

SessionLimitCollisionEvent $event:

File

src/Services/SessionLimit.php, line 258

Class

SessionLimit

Namespace

Drupal\session_limit\Services

Code

public function onSessionCollision(SessionLimitCollisionEvent $event) {
  switch ($this
    ->getCollisionBehaviour()) {
    case self::ACTION_ASK:
      $this
        ->_onSessionCollision__Ask();
      break;
    case self::ACTION_PREVENT_NEW:
      $this
        ->_onSessionCollision__PreventNew($event);
      break;
    case self::ACTION_DROP_OLDEST:
      $this
        ->_onSessionCollision__DropOldest($event);
      break;
  }
}