Tweaks to session split PR - #1096

This commit is contained in:
Andy Miller
2016-10-12 17:17:45 -06:00
parent 4f8ac36a9a
commit 05bd715d6c
3 changed files with 4 additions and 3 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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);