You are here

protected function SessionManager::migrateStoredSession in Drupal 8

Migrates the current session to a new session id.

Parameters

string $old_session_id: The old session ID. The new session ID is $this->getId().

1 call to SessionManager::migrateStoredSession()
SessionManager::regenerate in core/lib/Drupal/Core/Session/SessionManager.php
Regenerates id that represents this storage.

File

core/lib/Drupal/Core/Session/SessionManager.php, line 337

Class

SessionManager
Manages user sessions.

Namespace

Drupal\Core\Session

Code

protected function migrateStoredSession($old_session_id) {
  $fields = [
    'sid' => Crypt::hashBase64($this
      ->getId()),
  ];
  $this->connection
    ->update('sessions')
    ->fields($fields)
    ->condition('sid', Crypt::hashBase64($old_session_id))
    ->execute();
}