Call session_name() only if user gave an new one. Closes #1418
This commit is contained in:
parent
beecac3adb
commit
756ea8db39
@ -26,8 +26,8 @@ class NativeSessionStorage implements SessionStorageInterface
|
|||||||
/**
|
/**
|
||||||
* Available options:
|
* Available options:
|
||||||
*
|
*
|
||||||
* * name: The cookie name (_SESS by default)
|
* * name: The cookie name (null [ommited] by default)
|
||||||
* * id: The session id (null by default)
|
* * id: The session id (null [ommited] by default)
|
||||||
* * lifetime: Cookie lifetime
|
* * lifetime: Cookie lifetime
|
||||||
* * path: Cookie path
|
* * path: Cookie path
|
||||||
* * domain: Cookie domain
|
* * domain: Cookie domain
|
||||||
@ -43,15 +43,18 @@ class NativeSessionStorage implements SessionStorageInterface
|
|||||||
$cookieDefaults = session_get_cookie_params();
|
$cookieDefaults = session_get_cookie_params();
|
||||||
|
|
||||||
$this->options = array_merge(array(
|
$this->options = array_merge(array(
|
||||||
'name' => '_SESS',
|
'name' => null,
|
||||||
'lifetime' => $cookieDefaults['lifetime'],
|
'lifetime' => $cookieDefaults['lifetime'],
|
||||||
'path' => $cookieDefaults['path'],
|
'path' => $cookieDefaults['path'],
|
||||||
'domain' => $cookieDefaults['domain'],
|
'domain' => $cookieDefaults['domain'],
|
||||||
'secure' => $cookieDefaults['secure'],
|
'secure' => $cookieDefaults['secure'],
|
||||||
'httponly' => isset($cookieDefaults['httponly']) ? $cookieDefaults['httponly'] : false,
|
'httponly' => isset($cookieDefaults['httponly']) ? $cookieDefaults['httponly'] : false,
|
||||||
), $options);
|
), $options);
|
||||||
|
|
||||||
session_name($this->options['name']);
|
// Skip setting new session name if user don't wan't it
|
||||||
|
if (isset($this->options['name'])) {
|
||||||
|
session_name($this->options['name']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user