diff core/lib/Drupal/Core/Session/SessionManager.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Session/SessionManager.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/core/lib/Drupal/Core/Session/SessionManager.php	Thu Feb 28 13:21:36 2019 +0000
@@ -218,6 +218,11 @@
 
     if ($this->isStarted()) {
       $old_session_id = $this->getId();
+      // Save and close the old session. Call the parent method to avoid issue
+      // with session destruction due to the session being considered obsolete.
+      parent::save();
+      // Ensure the session is reloaded correctly.
+      $this->startedLazy = TRUE;
     }
     session_id(Crypt::randomBytesBase64());
 
@@ -230,10 +235,7 @@
       $this->migrateStoredSession($old_session_id);
     }
 
-    if (!$this->isStarted()) {
-      // Start the session when it doesn't exist yet.
-      $this->startNow();
-    }
+    $this->startNow();
   }
 
   /**