From a40c61a8fae808bbcfeab60baf733669b831d1b7 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Fri, 22 Jul 2016 15:20:04 +0200 Subject: [PATCH] Fix #952 hypenize the session name --- CHANGELOG.md | 1 + system/src/Grav/Common/Session.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a951b65a9..0130d2e38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Improved `authorize` Twig extension to accept a nested array of authorizations [#948](https://github.com/getgrav/grav/issues/948) 1. [](#bugfix) * Fixed `Folder::delete` method to recursively remove files and folders and causing Upgrade to fail. + * Fix [#952](https://github.com/getgrav/grav/issues/952) hypenize the session name. # v1.1.1 ## 07/16/2016 diff --git a/system/src/Grav/Common/Session.php b/system/src/Grav/Common/Session.php index 5a3987481..cc78410b1 100644 --- a/system/src/Grav/Common/Session.php +++ b/system/src/Grav/Common/Session.php @@ -67,7 +67,7 @@ public function init() $httponly = $config->get('system.session.httponly', true); $unique_identifier = GRAV_ROOT; - $this->setName($config->get('system.session.name', 'grav_site') . '-' . substr(md5($unique_identifier), 0, 7) . ($is_admin ? '-admin' : '')); + $this->setName(str_replace(' ', '-', $config->get('system.session.name', 'grav_site')) . '-' . substr(md5($unique_identifier), 0, 7) . ($is_admin ? '-admin' : '')); $this->start(); setcookie(session_name(), session_id(), time() + $session_timeout, $session_path, $domain, $secure, $httponly); }