We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 07801c3 + 93cfeb4 commit 70c197bCopy full SHA for 70c197b
src/PhpConsole/Storage/Session.php
@@ -21,8 +21,8 @@ class Session extends AllKeysList {
21
* @param bool $autoStart Start session if it's not started
22
*/
23
public function __construct($sessionKey = '__PHP_Console_postponed', $autoStart = true) {
24
- if($autoStart && (defined('PHP_SESSION_ACTIVE') ? session_status() != PHP_SESSION_ACTIVE : !session_id())) {
25
- session_start();
+ if($autoStart && (defined('PHP_SESSION_ACTIVE') ? session_status() != PHP_SESSION_ACTIVE : !session_id()) && !headers_sent()) {
+ session_start();
26
}
27
register_shutdown_function('session_write_close'); // force saving session data if session handler is overridden
28
$this->sessionKey = $sessionKey;
0 commit comments