From 05bd715d6cefa15ace822282f53eecd4f9db7f99 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 12 Oct 2016 17:17:45 -0600 Subject: [PATCH] Tweaks to session split PR - #1096 --- system/blueprints/config/system.yaml | 2 +- system/config/system.yaml | 1 + system/src/Grav/Common/Session.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index edf608711..94276a6f9 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -967,7 +967,7 @@ form: label: PLUGIN_ADMIN.SESSION_PATH help: PLUGIN_ADMIN.SESSION_PATH_HELP - session.split_admin: + session.split: type: toggle label: PLUGIN_ADMIN.SESSION_SPLIT help: PLUGIN_ADMIN.SESSION_SPLIT_HELP diff --git a/system/config/system.yaml b/system/config/system.yaml index f05262620..a219bd0a6 100644 --- a/system/config/system.yaml +++ b/system/config/system.yaml @@ -126,6 +126,7 @@ session: name: grav-site # Name prefix of the session cookie. Use alphanumeric, dashes or underscores only. Do not use dots in the session name secure: false # Set session secure. If true, indicates that communication for this cookie must be over an encrypted transmission. Enable this only on sites that run exclusively on HTTPS httponly: true # Set session HTTP only. If true, indicates that cookies should be used only over HTTP, and JavaScript modification is not allowed. + split: true # Sessions should be independent between site and plugins (such as admin) path: gpm: diff --git a/system/src/Grav/Common/Session.php b/system/src/Grav/Common/Session.php index 0298f75e7..a3827daa0 100644 --- a/system/src/Grav/Common/Session.php +++ b/system/src/Grav/Common/Session.php @@ -78,8 +78,8 @@ class Session extends BaseSession $unique_identifier = GRAV_ROOT; $inflector = new Inflector(); $session_name = $inflector->hyphenize($config->get('system.session.name', 'grav_site')) . '-' . substr(md5($unique_identifier), 0, 7); - $split_admin_session = $config->get('system.session.split_admin', true); - if ($is_admin && $split_admin_session) { + $split_session = $config->get('system.session.split', true); + if ($is_admin && $split_session) { $session_name .= '-admin'; } $this->setName($session_name);