From 5c507d5d912b01141c014ab07d0a5d3d5929732b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 16 Jul 2014 15:38:39 +0200 Subject: [PATCH] Fix notice that the session has been already started after retrieving its id --- library/Icinga/Web/Session/PhpSession.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/Session/PhpSession.php b/library/Icinga/Web/Session/PhpSession.php index 355d31186..65f940a13 100644 --- a/library/Icinga/Web/Session/PhpSession.php +++ b/library/Icinga/Web/Session/PhpSession.php @@ -196,8 +196,15 @@ class PhpSession extends Session */ public function getId() { - $this->open(); // Make sure we actually get a id - return session_id(); + if (($id = session_id()) === '') { + // Make sure we actually get a id + $this->open(); + session_write_close(); + $this->hasBeenTouched = true; + $id = session_id(); + } + + return $id; } /**