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:
José Lorenzo Rodríguez 2013-05-03 23:29:51 -07:00
commit 96a769dd34
2 changed files with 0 additions and 17 deletions

View file

@ -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;
}

View file

@ -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
*