You are here

protected function MongodbSessionManager::migrateStoredSession in MongoDB 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().

Overrides SessionManager::migrateStoredSession

File

mongodb_user/src/MongodbSessionManager.php, line 38
Contains \Drupal\mongodb_user\MongodbSessionManager.

Class

MongodbSessionManager

Namespace

Drupal\mongodb_user

Code

protected function migrateStoredSession($old_session_id) {
  $criteria = [
    'sid' => Crypt::hashBase64($old_session_id),
  ];
  $newobj = array(
    'sid' => Crypt::hashBase64($this
      ->getId()),
  );
  $this->mongo
    ->get('sessions')
    ->update($criteria, $newobj);
}