MetadataBag.php in Drupal 8
File
core/lib/Drupal/Core/Session/MetadataBag.php
View source
<?php
namespace Drupal\Core\Session;
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag as SymfonyMetadataBag;
class MetadataBag extends SymfonyMetadataBag {
const CSRF_TOKEN_SEED = 's';
public function __construct(Settings $settings) {
$update_threshold = $settings
->get('session_write_interval', 180);
parent::__construct('_sf2_meta', $update_threshold);
}
public function setCsrfTokenSeed($csrf_token_seed) {
$this->meta[static::CSRF_TOKEN_SEED] = $csrf_token_seed;
}
public function getCsrfTokenSeed() {
if (isset($this->meta[static::CSRF_TOKEN_SEED])) {
return $this->meta[static::CSRF_TOKEN_SEED];
}
}
public function clearCsrfTokenSeed() {
unset($this->meta[static::CSRF_TOKEN_SEED]);
}
}
Classes
Name |
Description |
MetadataBag |
Provides a container for application specific session metadata. |