diff --git a/lib/Cake/Model/Datasource/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php index 66497170f..96a66d899 100644 --- a/lib/Cake/Model/Datasource/CakeSession.php +++ b/lib/Cake/Model/Datasource/CakeSession.php @@ -267,7 +267,7 @@ class CakeSession { * @return bool Success */ public static function delete($name) { - if (self::start() && self::check($name)) { + if (self::check($name)) { self::_overwrite($_SESSION, Hash::remove($_SESSION, $name)); return !self::check($name); } diff --git a/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php b/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php index 677e38b76..7f70ea82c 100644 --- a/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php @@ -365,12 +365,6 @@ class CakeSessionTest extends CakeTestCase { * @return void */ public function testDelete() { - $this->assertTrue(TestCakeSession::write('Delete.me', 'Clearing out')); - - session_write_close(); - $this->assertTrue(TestCakeSession::delete('Delete.me')); - $this->assertFalse(TestCakeSession::check('Delete.me')); - $this->assertTrue(TestCakeSession::write('Delete.me', 'Clearing out')); $this->assertTrue(TestCakeSession::delete('Delete.me')); $this->assertFalse(TestCakeSession::check('Delete.me'));