From 1bfdc216d03ec0d87baa03d040135184df38e006 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 16 Aug 2016 21:35:12 +0200 Subject: [PATCH] Only close the session if it had been opened. --- boot.php | 4 +++- index.php | 6 ++++-- mod/hostxrd.php | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index 208293a925..ecaa73e6a3 100644 --- a/boot.php +++ b/boot.php @@ -1698,7 +1698,9 @@ function login($register = false, $hiddens=false) { * @brief Used to end the current process, after saving session state. */ function killme() { - session_write_close(); + if (!get_app()->is_backend()) + session_write_close(); + exit; } diff --git a/index.php b/index.php index 6ce348eac5..13c3f6318f 100644 --- a/index.php +++ b/index.php @@ -489,7 +489,8 @@ if (isset($_GET["mode"]) AND ($_GET["mode"] == "raw")) { echo substr($target->saveHTML(), 6, -8); - session_write_close(); + if (!$a->is_backend()) + session_write_close(); exit; } @@ -514,5 +515,6 @@ if(!$template) { require_once($template); -session_write_close(); +if (!$a->is_backend()) + session_write_close(); exit; diff --git a/mod/hostxrd.php b/mod/hostxrd.php index 4121764f1a..647073b056 100644 --- a/mod/hostxrd.php +++ b/mod/hostxrd.php @@ -25,7 +25,6 @@ function hostxrd_init(&$a) { '$zot_post' => z_root() . '/post', '$bigkey' => salmon_key(get_config('system','site_pubkey')), )); - session_write_close(); exit(); }