From c128505a2c254ef183c8a6088e559eeb2c32c8e0 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 10 Oct 2008 17:24:10 +0000 Subject: [PATCH] Adding read() into CookieComponent::del() so that values will always be populated. Reversing change from [7725]. Fixes #5563 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7729 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/controller/components/cookie.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index 524933ec1..bd1babf95 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -274,13 +274,15 @@ class CookieComponent extends Object { * @access public */ function del($key) { + if (empty($this->__values)) { + $this->read(); + } $name = $this->__cookieVarNames($key); - if (count($name) > 1) { if (isset($this->__values[$name[0]])) { + $this->__delete("[".$name[0]."][".$name[1]."]"); unset($this->__values[$name[0]][$name[1]]); } - $this->__delete("[".$name[0]."][".$name[1]."]"); } else { if (isset($this->__values[$name[0]])) { if (is_array($this->__values[$name[0]])) {