You are here

protected function SessionLimit::_onSessionCollision__Ask in Session Limit 8

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

React to a session collision by asking the user which session to end.

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

File

src/Services/SessionLimit.php, line 260

Class

SessionLimit

Namespace

Drupal\session_limit\Services

Code

protected function _onSessionCollision__Ask() {
  $this->messenger
    ->addMessage(t('You have too many active sessions. Please choose a session to end.'));
  $response = new RedirectResponse(Url::fromRoute('session_limit.limit_form')
    ->toString(), 307, [
    'Cache-Control' => 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
    'Expires' => 'Sat, 26 Jul 1997 05:00:00 GMT',
  ]);
  $response
    ->send();
  exit;
}