本文整理汇总了PHP中lithium\storage\Session::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::reset方法的具体用法?PHP Session::reset怎么用?PHP Session::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lithium\storage\Session
的用法示例。
在下文中一共展示了Session::reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
public function tearDown()
{
Session::reset();
$cookies = array_keys($_COOKIE);
foreach ($cookies as $cookie) {
setcookie($cookie, "", time() - 1);
}
}
示例2: testSessionStateResetNamed
public function testSessionStateResetNamed()
{
Session::reset();
$this->expectException("Configuration `default` has not been defined.");
$this->assertFalse(Session::isStarted('default'));
}
示例3: testHmacStrategyWithPhpAdapter
public function testHmacStrategyWithPhpAdapter()
{
$this->skipIf(PHP_SAPI === 'cli', 'No PHP session support in cli SAPI.');
$config = array('name' => 'hmacInt');
Session::config(array($config['name'] => array('adapter' => 'Php', 'strategies' => array('Hmac' => array('secret' => 's3cr3t')))));
Session::clear($config);
$key = 'test';
$value = 'value';
$this->assertTrue(Session::write($key, $value, $config));
$this->assertEqual($value, Session::read($key, $config));
$this->assertTrue(Session::delete($key, $config));
$this->assertNull(Session::read($key, $config));
Session::clear($config);
$this->assertTrue(Session::write('foo', 'bar', $config));
$this->assertEqual('bar', Session::read('foo', $config));
$this->assertTrue(Session::write('foo', 'bar1', $config));
$this->assertEqual('bar1', Session::read('foo', $config));
Session::clear($config);
$this->assertTrue(Session::write($key, $value, $config));
$this->assertEqual($value, Session::read($key, $config));
$cache = $_SESSION;
$_SESSION['injectedkey'] = 'hax0r';
$expected = '/Possible data tampering: HMAC signature does not match data./';
$this->asssertException($expected, function () use($key, $config) {
Session::read($key, $config);
});
$_SESSION = $cache;
Session::reset();
}