You are here

public function MetadataBag::stampNew in Drupal 10

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Session/MetadataBag.php \Drupal\Core\Session\MetadataBag::stampNew()

File

core/lib/Drupal/Core/Session/MetadataBag.php, line 55

Class

MetadataBag
Provides a container for application specific session metadata.

Namespace

Drupal\Core\Session

Code

public function stampNew($lifetime = NULL) {
  parent::stampNew($lifetime);

  // Set the token seed immediately to avoid a race condition between two
  // simultaneous requests without a seed.
  $this
    ->setCsrfTokenSeed(Crypt::randomBytesBase64());
}