Skip to content
Snippets Groups Projects
Commit 03d72a8f authored by Olav Morken's avatar Olav Morken
Browse files

Allow session_save_path to be overridden by setting the...

Allow session_save_path to be overridden by setting the session.phpsession.savepath option in config.php.


git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@556 44740490-163a-0410-bde0-09ae8108e29a
parent 40a4cf31
No related branches found
No related tags found
No related merge requests found
......@@ -123,8 +123,12 @@ $config = array (
'session.duration' => 8 * (60*60), // 8 hours.
'session.requestcache' => 4 * (60*60), // 4 hours
/*
* Options to override the default settings for php sessions.
*/
'session.phpsession.cookiename' => null,
'session.phpsession.limitedpath' => false,
'session.phpsession.savepath' => null,
/*
* Languages available and what language is default
......
......@@ -41,6 +41,11 @@ class SimpleSAML_SessionHandlerPHP extends SimpleSAML_SessionHandler {
$cookiename = $config->getValue('session.phpsession.cookiename', NULL);
if (!empty($cookiename)) session_name($cookiename);
$savepath = $config->getValue('session.phpsession.savepath', NULL);
if(!empty($savepath)) {
session_save_path($savepath);
}
if(!array_key_exists(session_name(), $_COOKIE)) {
/* Session cookie unset - session id not set. Generate new (secure) session id. */
session_id(SimpleSAML_Utilities::stringToHex(SimpleSAML_Utilities::generateRandomBytes(16)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment