for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nofw\Session;
use Doctrine\Common\Cache\Cache;
/**
* Doctrine Cache Session handler implementation.
*
* @author Márk Sági-Kazár <[email protected]>
*/
final class DoctrineCacheSessionHandler implements \SessionHandlerInterface
{
* @var Cache
private $cache;
* @param Cache $cache
public function __construct(Cache $cache)
$this->cache = $cache;
}
* {@inheritdoc}
public function close()
return true;
public function destroy($session_id)
return $this->cache->delete($session_id);
public function gc($maxlifetime)
public function open($save_path, $name)
public function read($session_id)
return (string) $this->cache->fetch($session_id);
public function write($session_id, $session_data)
return $this->cache->save($session_id, $session_data);