diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index a6fa11d..10b92f5 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1694,11 +1694,13 @@ function install_finished(&$install_state) { $snapshot = \Drupal::service('config.storage.snapshot'); \Drupal::service('config.manager')->createSnapshot($active, $snapshot); - // Load current user and perform final login tasks. - // This has to be done after drupal_flush_all_caches() - // to avoid session regeneration. - $account = user_load(1); - user_login_finalize($account); + if ($install_state['interactive']) { + // Load current user and perform final login tasks. + // This has to be done after drupal_flush_all_caches() + // to avoid session regeneration. + $account = user_load(1); + user_login_finalize($account); + } // @todo Temporary hack to satisfy PIFR. // @see https://drupal.org/node/1317548 diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index c382463..30a57da 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -909,11 +909,6 @@ protected function setUp() { chmod($directory, 0777); $request = \Drupal::request(); - // If there is a session manager, close and save the session. - if (\Drupal::getContainer()->initialized('session_manager')) { - \Drupal::service('session_manager')->save(); - } - $this->kernel = DrupalKernel::createFromRequest($request, drupal_classloader(), 'prod', TRUE); $this->kernel->prepareLegacyRequest($request); // Force the container to be built from scratch instead of loaded from the