Skip to content
Permalink
Browse files

Set session save handler when the engine is swapped.

Refs #11895
  • Loading branch information...
markstory committed Apr 14, 2018
1 parent 40ec1f4 commit 2a4c1a4393c98f51f7ef86e64b86875e0979e954
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/Network/Session.php
@@ -221,10 +221,7 @@ public function __construct(array $config = [])
if (!empty($config['handler']['engine'])) {
$class = $config['handler']['engine'];
unset($config['handler']['engine']);
$engine = $this->engine($class, $config['handler']);
if (!headers_sent()) {
session_set_save_handler($engine, false);
}
$this->engine($class, $config['handler']);
}
$this->_lifetime = ini_get('session.gc_maxlifetime');
@@ -272,6 +269,9 @@ public function engine($class = null, array $options = [])
'The chosen SessionHandler does not implement SessionHandlerInterface, it cannot be used as an engine.'
);
}
if (!headers_sent()) {
session_set_save_handler($handler, false);
}
return $this->_engine = $handler;
}

0 comments on commit 2a4c1a4

Please sign in to comment.
You can’t perform that action at this time.