Skip to content

Commit 1c1bb68

Browse files
authored
Merge pull request #1679 from nowackipawel/patch-39
save_path - for memcached (Session.php) + sess_prefix (..Handler.php)
2 parents 415b805 + 3fd233e commit 1c1bb68

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

system/Session/Handlers/MemcachedHandler.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public function __construct(BaseConfig $config, string $ipAddress)
9494
{
9595
$this->keyPrefix .= $this->ipAddress . ':';
9696
}
97+
98+
if(!empty($this->keyPrefix))
99+
{
100+
ini_set('memcached.sess_prefix', $this->keyPrefix);
101+
}
97102

98103
$this->sessionExpiration = $config->sessionExpiration;
99104
}
@@ -184,7 +189,7 @@ public function read($sessionID)
184189
return $session_data;
185190
}
186191

187-
return false;
192+
return '';
188193
}
189194

190195
//--------------------------------------------------------------------

system/Session/Session.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ protected function configure()
303303
{
304304
ini_set('session.gc_maxlifetime', (int) $this->sessionExpiration);
305305
}
306+
307+
if(!empty($this->sessionSavePath))
308+
{
309+
ini_set('session.save_path', $this->sessionSavePath);
310+
}
306311

307312
// Security is king
308313
ini_set('session.use_trans_sid', 0);

0 commit comments

Comments
 (0)