From e7ab5a457923c905fa916983ff462f5d3e1d4d60 Mon Sep 17 00:00:00 2001 From: Sebastian Rapetti Date: Tue, 8 Nov 2016 23:08:35 +0100 Subject: [PATCH] Session->start() fix Now call session->start() more than one time don't cause a error --- src/Linna/Session/Session.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Linna/Session/Session.php b/src/Linna/Session/Session.php index ab1c8f56..64b908b0 100644 --- a/src/Linna/Session/Session.php +++ b/src/Linna/Session/Session.php @@ -151,17 +151,20 @@ private function setCookie() */ public function start() { - //prepare session start - $this->prepare(); + if (session_status() !== 2) + { + //prepare session start + $this->prepare(); - //start session - session_start(); - - //set new cookie - $this->setCookie(); + //start session + session_start(); - //link session super global to $data property - $this->data = &$_SESSION; + //set new cookie + $this->setCookie(); + + //link session super global to $data property + $this->data = &$_SESSION; + } //refresh session $this->refresh();