mirror of
https://github.com/getgrav/grav.git
synced 2026-03-05 03:51:50 +01:00
Tweaks to session split PR - #1096
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user