Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobocoder <anthon.pang@gmail.com>2010-04-25 18:38:03 +0400
committerrobocoder <anthon.pang@gmail.com>2010-04-25 18:38:03 +0400
commit60672c348ba8c697b3b8eabe510d1b6694300df0 (patch)
tree262f9bbe60634abe07e6f5f26a7c6e7685ed0b67 /core/Session.php
parentd987b1962b505b134eebc748e343d96f38e9f5a0 (diff)
refs #1279 - fallback to system default
git-svn-id: http://dev.piwik.org/svn/trunk@2122 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Session.php')
-rw-r--r--core/Session.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/Session.php b/core/Session.php
index d4f11e9ef9..45e1e01209 100644
--- a/core/Session.php
+++ b/core/Session.php
@@ -30,7 +30,8 @@ class Piwik_Session extends Zend_Session
@ini_set('session.save_path', '');
}
- // for "files", we want a writeable folder
+ // for "files", we want a writeable folder;
+ // for shared hosting, we assume the web server has been securely configured to prevent local session file hijacking
if(ini_get('session.save_handler') == 'files')
{
$sessionPath = ini_get('session.save_path');
@@ -41,21 +42,28 @@ class Piwik_Session extends Zend_Session
if(ini_get('safe_mode') || ini_get('open_basedir') || empty($sessionPath) || !@is_writable($sessionPath))
{
$sessionPath = PIWIK_USER_PATH . '/tmp/sessions';
+ $ok = true;
if(!is_dir($sessionPath))
{
@mkdir($sessionPath, 0755, true);
if(!is_dir($sessionPath))
{
- die("Error: Unable to mkdir $sessionPath");
+ // Unable to mkdir $sessionPath
+ $ok = false;
}
}
else if(!@is_writable($sessionPath))
{
- die("Error: $sessionPath is not writable");
+ // $sessionPath is not writable
+ $ok = false;
}
- @ini_set('session.save_path', $sessionPath);
+ if($ok)
+ {
+ @ini_set('session.save_path', $sessionPath);
+ }
+ // else rely on default setting (assuming it is configured to a writeable folder)
}
}