Removing unused setting in Session configuration.

Fixed bug in CakeSession::watch(); that allowed setting multiple vars to watch and CakeSession::ignore(); would only unset the first one found.
Fixed errors being thrown when testing database sessions and the database was dropped before script process ended.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8103 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2009-03-15 00:27:25 +00:00
parent 3748987599
commit e3b027288b
2 changed files with 8 additions and 3 deletions

View file

@ -349,7 +349,9 @@ class CakeSession extends Object {
if (empty($var)) {
return false;
}
$this->watchKeys[] = $var;
if (!in_array($var, $this->watchKeys, true)) {
$this->watchKeys[] = $var;
}
}
/**
* Tells Session to stop watching a given key path
@ -571,10 +573,8 @@ class CakeSession extends Object {
$this->__setError(1, 'Session Highjacking Attempted !!!');
}
} else {
srand ((double)microtime() * 1000000);
$this->write('Config.userAgent', $this->_userAgent);
$this->write('Config.time', $this->sessionTime);
$this->write('Config.rand', mt_rand());
$this->write('Config.timeout', 10);
$this->valid = true;
$this->__setError(1, 'Session is valid');

View file

@ -369,6 +369,11 @@ class SessionTest extends CakeTestCase {
$this->Session->destroy();
$this->assertFalse($this->Session->read('SessionTestCase'));
session_write_close();
unset($_SESSION);
ini_set('session.save_handler', 'files');
Configure::write('Session.save', 'php');
$this->setUp();
}
}
?>