public function read($id)
 {
     $data = parent::read($id);
     if (!$data) {
         return "";
     } else {
         return decrypt($data, $this->key);
     }
 }
 /**
  * This function is automatically called after the "open" function
  * Use the PHP default "read" function, then save the data and close the session if the session has not to be locked
  *
  * @param string $session_id
  *
  * @return string
  */
 public function read($session_id)
 {
     $data = parent::read($session_id);
     $this->session = $this->unserialize_session_data($data);
     if (!$this->lock) {
         $_SESSION = $this->session;
         session_write_close();
     }
     return $data;
 }
 public function test_write_without_ttl()
 {
     $client = $this->prophesize('Blablacar\\Memcached\\Test\\Client');
     $client->quit()->shouldBeCalledTimes(1);
     $client->set(Argument::type('string'), Argument::type('string'))->will(function ($args) {
         $this->get($args[0])->willReturn($args[1])->shouldBeCalledTimes(1);
         return true;
     })->shouldBeCalledTimes(1);
     $handler = new SessionHandler($client->reveal());
     $this->assertTrue($handler->write('key', 'value'));
     $this->assertEquals('value', $handler->read('key'));
 }
Esempio n. 4
0
 /**
  * Workaround for php7 session_regenerate_id error
  * @see https://bugs.php.net/bug.php?id=71187
  *
  * @param string $sessionId
  * @return string
  */
 public function read($sessionId)
 {
     return (string) parent::read($sessionId);
 }
 public function read($key)
 {
     ++$this->i;
     echo 'Read ', session_id(), "\n";
     return parent::read($key);
 }
Esempio n. 6
0
 /**
  * Read session data
  *
  * @param string $sessionId
  * @return string
  */
 public function read($sessionId)
 {
     return $this->saveHandlerAdapter->read($sessionId);
 }
 public function read($session_id)
 {
     $data = parent::read($session_id);
     return mcrypt_decrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB);
 }
Esempio n. 8
0
 public function read($id)
 {
     return mcrypt_decrypt(MCRYPT_3DES, $this->key, parent::read($id), MCRYPT_MODE_ECB);
 }
Esempio n. 9
0
 /**
  * {@inheritdoc }
  */
 public function read($sessionId)
 {
     return (string) $this->handler->read($sessionId);
 }
 public function read($key)
 {
     ++$this->i;
     return parent::read($key);
 }
Esempio n. 11
0
 public function read($id)
 {
     $data = parent::read($id);
     $data = mcrypt_decrypt(MCRYPT_3DES, $this->s_session_key, $data, MCRYPT_MODE_ECB);
     return $data;
 }
Esempio n. 12
0
 public function read($session_id)
 {
     return mcrypt_decrypt(self::$cipher, \Config::$encryptionKey, parent::read($session_id), self::$mode);
 }
 public function read($id)
 {
     // should error because parent::open hasn't been called
     return parent::read($id);
 }
Esempio n. 14
0
 public function read($session_id)
 {
     return parent::read($session_id);
 }
Esempio n. 15
0
 /**
  * Reads data from session.
  *
  * @param string $id The session id
  *
  * @return string session data
  */
 public function read($id)
 {
     return mcrypt_decrypt($this->sessionCipherAlgorithm, $this->sessionCipherKey, parent::read($id), $this->sessionCipherMode);
 }
Esempio n. 16
0
 public function read($key)
 {
     $this->initRedis();
     $this->lock($key);
     return parent::read($key);
 }
Esempio n. 17
0
 public function read($id)
 {
     $data = parent::read($id);
     var_dump($data);
     return mcrypt_decrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB);
 }