Skip to content

Commit

Permalink
Merge pull request #1679 from nowackipawel/patch-39
Browse files Browse the repository at this point in the history
save_path - for memcached (Session.php) + sess_prefix (..Handler.php)
  • Loading branch information
lonnieezell authored Jan 25, 2019
2 parents 415b805 + 3fd233e commit 1c1bb68
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion system/Session/Handlers/MemcachedHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public function __construct(BaseConfig $config, string $ipAddress)
{
$this->keyPrefix .= $this->ipAddress . ':';
}

if(!empty($this->keyPrefix))
{
ini_set('memcached.sess_prefix', $this->keyPrefix);
}

$this->sessionExpiration = $config->sessionExpiration;
}
Expand Down Expand Up @@ -184,7 +189,7 @@ public function read($sessionID)
return $session_data;
}

return false;
return '';
}

//--------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions system/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ protected function configure()
{
ini_set('session.gc_maxlifetime', (int) $this->sessionExpiration);
}

if(!empty($this->sessionSavePath))
{
ini_set('session.save_path', $this->sessionSavePath);
}

// Security is king
ini_set('session.use_trans_sid', 0);
Expand Down

0 comments on commit 1c1bb68

Please sign in to comment.