You are here

protected function CasUserManager::storeLoginSessionData in CAS 2.x

Same name and namespace in other branches
  1. 8 src/Service/CasUserManager.php \Drupal\cas\Service\CasUserManager::storeLoginSessionData()

Store the Session ID and ticket for single-log-out purposes.

Parameters

string $session_id: The session ID, to be used to kill the session later.

string $ticket: The CAS service ticket to be used as the lookup key.

1 call to CasUserManager::storeLoginSessionData()
CasUserManager::login in src/Service/CasUserManager.php
Attempts to log the user in to the Drupal site.

File

src/Service/CasUserManager.php, line 252

Class

CasUserManager
Provides the 'cas.user_manager' service default implementation.

Namespace

Drupal\cas\Service

Code

protected function storeLoginSessionData($session_id, $ticket) {
  if ($this->settings
    ->get('cas.settings')
    ->get('logout.enable_single_logout') === TRUE) {
    $this->connection
      ->insert('cas_login_data')
      ->fields([
      'sid',
      'plainsid',
      'ticket',
      'created',
    ], [
      Crypt::hashBase64($session_id),
      $session_id,
      $ticket,
      time(),
    ])
      ->execute();
  }
}