mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merge pull request #1265 from ADmad/master-cakesession-valid
Ensure session is not invalidated after reading/deleting non-existent key.
This commit is contained in:
commit
96a769dd34
2 changed files with 0 additions and 17 deletions
|
@ -250,7 +250,6 @@ class CakeSession {
|
|||
self::_overwrite($_SESSION, Hash::remove($_SESSION, $name));
|
||||
return !self::check($name);
|
||||
}
|
||||
self::_setError(2, __d('cake_dev', "%s doesn't exist", $name));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -370,7 +369,6 @@ class CakeSession {
|
|||
if (isset($result)) {
|
||||
return $result;
|
||||
}
|
||||
self::_setError(2, "$name doesn't exist");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -347,21 +347,6 @@ class CakeSessionTest extends CakeTestCase {
|
|||
$this->assertTrue(TestCakeSession::started());
|
||||
}
|
||||
|
||||
/**
|
||||
* testError method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testError() {
|
||||
TestCakeSession::read('Does.not.exist');
|
||||
$result = TestCakeSession::error();
|
||||
$this->assertEquals("Does.not.exist doesn't exist", $result);
|
||||
|
||||
TestCakeSession::delete('Failing.delete');
|
||||
$result = TestCakeSession::error();
|
||||
$this->assertEquals("Failing.delete doesn't exist", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testDel method
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue