Browse Source

Merge pull request #12638 from garas/session_handler_php72

Do not change session handler if session is active
Mark Story 7 years ago
parent
commit
1c8dd01864
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Http/Session.php

+ 2 - 2
src/Http/Session.php

@@ -290,7 +290,7 @@ class Session
      */
     protected function setEngine(SessionHandlerInterface $handler)
     {
-        if (!headers_sent()) {
+        if (!headers_sent() && session_status() !== \PHP_SESSION_ACTIVE) {
             session_set_save_handler($handler, false);
         }
 
@@ -535,7 +535,7 @@ class Session
             $this->start();
         }
 
-        if (!$this->_isCLI && session_status() === PHP_SESSION_ACTIVE) {
+        if (!$this->_isCLI && session_status() === \PHP_SESSION_ACTIVE) {
             session_destroy();
         }