Making CakeSession destory() make started() not return true. Fixing tests that tried to modify session config while a session was active.

This commit is contained in:
mark_story 2010-07-07 23:40:33 -04:00
parent daab018777
commit f47ee0d29a
2 changed files with 3 additions and 1 deletions

View file

@ -445,7 +445,7 @@ class CakeSession {
* @return void * @return void
*/ */
public function destroy() { public function destroy() {
$_SESSION = array(); $_SESSION = null;
self::$id = null; self::$id = null;
self::init(self::$path); self::init(self::$path);
self::start(); self::start();

View file

@ -366,6 +366,7 @@ class CakeSessionTest extends CakeTestCase {
* @return void * @return void
*/ */
function testReadAndWriteWithCakeStorage() { function testReadAndWriteWithCakeStorage() {
session_write_close();
ini_set('session.save_handler', 'files'); ini_set('session.save_handler', 'files');
Configure::write('Session.save', 'cake'); Configure::write('Session.save', 'cake');
$this->setUp(); $this->setUp();
@ -401,6 +402,7 @@ class CakeSessionTest extends CakeTestCase {
* @return void * @return void
*/ */
function testReadAndWriteWithCacheStorage() { function testReadAndWriteWithCacheStorage() {
session_write_close();
ini_set('session.save_handler', 'files'); ini_set('session.save_handler', 'files');
Configure::write('Session.save', 'cache'); Configure::write('Session.save', 'cache');
$this->setUp(); $this->setUp();