/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Http/Session
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Http/Session/CacheSession.php (3690B)
_options = $config;
}
/**
* Method called on open of a database session.
*
* @param string $savePath The path where to store/retrieve the session.
* @param string $name The session name.
* @return bool Success
*/
public function open($savePath, $name): bool
{
return true;
}
/**
* Method called on close of a database session.
*
* @return bool Success
*/
public function close(): bool
{
return true;
}
/**
* Method used to read from a cache session.
*
* @param string $id ID that uniquely identifies session in cache.
* @return string Session data or empty string if it does not exist.
*/
public function read($id): string
{
$value = Cache::read($id, $this->_options['config']);
if (empty($value)) {
return '';
}
return $value;
}
/**
* Helper function called on write for cache sessions.
*
* @param string $id ID that uniquely identifies session in cache.
* @param string $data The data to be saved.
* @return bool True for successful write, false otherwise.
*/
public function write($id, $data): bool
{
if (!$id) {
return false;
}
return (bool)Cache::write($id, $data, $this->_options['config']);
}
/**
* Method called on the destruction of a cache session.
*
* @param string $id ID that uniquely identifies session in cache.
* @return bool Always true.
*/
public function destroy($id): bool
{
Cache::delete($id, $this->_options['config']);
return true;
}
/**
* No-op method. Always returns true since cache engine don't have garbage collection.
*
* @param int $maxlifetime Sessions that have not updated for the last maxlifetime seconds will be removed.
* @return bool Always true.
*/
public function gc($maxlifetime): bool
{
return true;
}
}