Revert "Merge pull request #4405 from php-engineer/master-session-bugfix"

This reverts commit 5863adda42, reversing
changes made to 4c37cf6d4b.

There was no real issue. The lack of session cookie in CLI makes writing
tests a bit tricky which caused the confusion. Refs #4405, #4451.
This commit is contained in:
ADmad 2014-09-01 00:17:53 +05:30
parent c26b381469
commit d60cd3ab2f
2 changed files with 1 additions and 7 deletions

View file

@ -267,7 +267,7 @@ class CakeSession {
* @return bool Success * @return bool Success
*/ */
public static function delete($name) { public static function delete($name) {
if (self::start() && self::check($name)) { if (self::check($name)) {
self::_overwrite($_SESSION, Hash::remove($_SESSION, $name)); self::_overwrite($_SESSION, Hash::remove($_SESSION, $name));
return !self::check($name); return !self::check($name);
} }

View file

@ -365,12 +365,6 @@ class CakeSessionTest extends CakeTestCase {
* @return void * @return void
*/ */
public function testDelete() { 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::write('Delete.me', 'Clearing out'));
$this->assertTrue(TestCakeSession::delete('Delete.me')); $this->assertTrue(TestCakeSession::delete('Delete.me'));
$this->assertFalse(TestCakeSession::check('Delete.me')); $this->assertFalse(TestCakeSession::check('Delete.me'));