/**
  * @param string $id
  * @param string $data
  *
  * @return bool
  */
 public function write($id, $data)
 {
     try {
         $key = $this->formatKey($id);
         $this->ssIds[$key] = $this->client->lock($key);
         $this->client->setex($key, ini_get("session.gc_maxlifetime"), $data);
         return TRUE;
     } catch (Exception $e) {
         Debugger::log($e, 'redis-session');
         return FALSE;
     }
 }
Exemple #2
0
 /**
  * @param string $id
  * @param string $data
  * @return bool
  */
 public function write($id, $data)
 {
     if (!isset($this->ssIds[$id])) {
         return FALSE;
     }
     return $this->client->setex($this->formatKey($id), $this->getTtl(), $data);
 }