本文整理汇总了PHP中SessionHandler::read方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionHandler::read方法的具体用法?PHP SessionHandler::read怎么用?PHP SessionHandler::read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionHandler
的用法示例。
在下文中一共展示了SessionHandler::read方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: read
public function read($id)
{
$data = parent::read($id);
if (!$data) {
return "";
} else {
return decrypt($data, $this->key);
}
}
示例2: read
/**
* 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;
}
开发者ID:xhuberty,项目名称:utils.session.optimistic-session-handler,代码行数:18,代码来源:OptimisticSessionHandler.php
示例3: test_write_without_ttl
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'));
}
示例4: read
/**
* 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);
}
示例5: read
public function read($key)
{
++$this->i;
echo 'Read ', session_id(), "\n";
return parent::read($key);
}
示例6: read
/**
* Read session data
*
* @param string $sessionId
* @return string
*/
public function read($sessionId)
{
return $this->saveHandlerAdapter->read($sessionId);
}
示例7: read
public function read($session_id)
{
$data = parent::read($session_id);
return mcrypt_decrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB);
}
示例8: read
public function read($id)
{
return mcrypt_decrypt(MCRYPT_3DES, $this->key, parent::read($id), MCRYPT_MODE_ECB);
}
示例9: read
/**
* {@inheritdoc }
*/
public function read($sessionId)
{
return (string) $this->handler->read($sessionId);
}
示例10: read
public function read($key)
{
++$this->i;
return parent::read($key);
}
示例11: read
public function read($id)
{
$data = parent::read($id);
$data = mcrypt_decrypt(MCRYPT_3DES, $this->s_session_key, $data, MCRYPT_MODE_ECB);
return $data;
}
示例12: read
public function read($session_id)
{
return mcrypt_decrypt(self::$cipher, \Config::$encryptionKey, parent::read($session_id), self::$mode);
}
示例13: read
public function read($id)
{
// should error because parent::open hasn't been called
return parent::read($id);
}
示例14: read
public function read($session_id)
{
return parent::read($session_id);
}
示例15: read
/**
* 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);
}