Finished retro-fitting CakeSession::del() (Ticket #2163)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4552 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-02-22 19:53:25 +00:00
parent 105b17799a
commit 2650c3a582

View file

@ -201,15 +201,13 @@ class CakeSession extends Object {
*/
function del($name) {
if ($this->check($name)) {
$var = $this->__sessionVarNames($name);
if (empty($var)) {
return false;
if ($var = $this->__validateKeys($name)) {
if (in_array($var, $this->watchKeys)) {
trigger_error('Deleting session key {' . $var . '}', E_USER_NOTICE);
}
$this->__overwrite($_SESSION, Set::remove($_SESSION, $var));
return ($this->check($var) == false);
}
if (in_array($var, $this->watchKeys)) {
trigger_error('Deleting session key {' . $var . '}', E_USER_NOTICE);
}
$this->__overwrite($_SESSION, Set::remove($_SESSION, $var));
return ($this->check($var) == false);
}
$this->__setError(2, "$name doesn't exist");
return false;