Removed memcached session option

Memcached is considered a bad choice for sessions as when it's full, it purges old keys and could end up purging user sessions. You can solve this with more memory, but it's a ton easier to keep it on disk in a single server setup and in the database when running a cluster.
This commit is contained in:
Josh Sherman 2012-10-10 19:23:06 -04:00
parent b7d7bfe1e7
commit 8dc808330c
2 changed files with 2 additions and 42 deletions

View file

@ -137,7 +137,7 @@ class Session extends Object
if (is_array($session))
{
if (isset($session['handler']) && in_array($session['handler'], array('files', 'memcache', 'mysql')))
if (isset($session['handler']) && in_array($session['handler'], array('files', 'mysql')))
{
$this->handler = $session['handler'];
@ -161,11 +161,6 @@ class Session extends Object
{
$this->handler = 'files';
}
elseif ($session == 'memcache')
{
$this->handler = 'memcache';
$datasource = 'memcached';
}
elseif ($session == 'mysql')
{
$this->handler = 'mysql';
@ -180,21 +175,6 @@ class Session extends Object
session_start();
break;
case 'memcache':
$hostname = 'localhost';
$port = 11211;
if ($datasource !== false && isset($datasources[$datasource]))
{
$hostname = $datasources[$datasource]['hostname'];
$port = $datasources[$datasource]['port'];
}
ini_set('session.save_handler', 'memcache');
ini_set('session.save_path', 'tcp://' . $hostname . ':' . $port . '?persistent=1&weight=1&timeout=1&retry_interval=15');
session_start();
break;
case 'mysql':
if ($datasource !== false && isset($datasources[$datasource]))
{

22
jar.php
View file

@ -6464,7 +6464,7 @@ class Session extends Object
if (is_array($session))
{
if (isset($session['handler']) && in_array($session['handler'], array('files', 'memcache', 'mysql')))
if (isset($session['handler']) && in_array($session['handler'], array('files', 'mysql')))
{
$this->handler = $session['handler'];
@ -6488,11 +6488,6 @@ class Session extends Object
{
$this->handler = 'files';
}
elseif ($session == 'memcache')
{
$this->handler = 'memcache';
$datasource = 'memcached';
}
elseif ($session == 'mysql')
{
$this->handler = 'mysql';
@ -6507,21 +6502,6 @@ class Session extends Object
session_start();
break;
case 'memcache':
$hostname = 'localhost';
$port = 11211;
if ($datasource !== false && isset($datasources[$datasource]))
{
$hostname = $datasources[$datasource]['hostname'];
$port = $datasources[$datasource]['port'];
}
ini_set('session.save_handler', 'memcache');
ini_set('session.save_path', 'tcp://' . $hostname . ':' . $port . '?persistent=1&weight=1&timeout=1&retry_interval=15');
session_start();
break;
case 'mysql':
if ($datasource !== false && isset($datasources[$datasource]))
{