protected function SynchronizeCsrfTokenSeedTrait::drupalLogin in Drupal 10
File
- core/
modules/ ckeditor5/ tests/ src/ Traits/ SynchronizeCsrfTokenSeedTrait.php, line 27
Class
- SynchronizeCsrfTokenSeedTrait
- Synchronizes the child site's CSRF token seed back to the test runner.
Namespace
Drupal\Tests\ckeditor5\TraitsCode
protected function drupalLogin(AccountInterface $account) {
parent::drupalLogin($account);
$session_data = $this->container
->get('session_handler.write_safe')
->read($this
->getSession()
->getCookie($this
->getSessionName()));
$csrf_token_seed = unserialize(explode('_sf2_meta|', $session_data)[1])['s'];
$this->container
->get('session_manager.metadata_bag')
->setCsrfTokenSeed($csrf_token_seed);
}