Quellcode durchsuchen

[HttpFoundation] updated session to only save on destruct if started

Kris Wallsmith vor 14 Jahren
Ursprung
Commit
fc5992495f
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 3 1
      src/Symfony/Component/HttpFoundation/Session.php

+ 3 - 1
src/Symfony/Component/HttpFoundation/Session.php

@@ -287,7 +287,9 @@ class Session implements \Serializable
 
     public function __destruct()
     {
-        $this->save();
+        if (true === $this->started) {
+            $this->save();
+        }
     }
 
     public function serialize()