diff --git a/src/Components/Request.php b/src/Components/Request.php index 7ac26d72..5cfd41cc 100644 --- a/src/Components/Request.php +++ b/src/Components/Request.php @@ -82,12 +82,17 @@ public function cookieKeys() { // get data in $_SESSION : make sure session is started before calling this. public function sessionData($key) { + // make sure session is running + if (session_status == PHP_SESSION_NONE) + session_start(); return isset($_SESSION[$key]) ? $_SESSION[$key] : NULL; } // get all the session keys public function sessionKeys() { + if (session_status == PHP_SESSION_NONE) + session_start(); return array_keys($_SESSION); }