// set-cookie is now make one time in destructor

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17595 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-09-27 16:42:34 +00:00
parent 9142792d30
commit 9b64fecd0d
+6 -4
View File
@@ -159,7 +159,6 @@ class CookieCore
if (!$this->_modified && (!isset($this->_content[$key]) || (isset($this->_content[$key]) && $this->_content[$key] != $value)))
$this->_modified = true;
$this->_content[$key] = $value;
$this->write();
}
/**
@@ -172,7 +171,6 @@ class CookieCore
if (isset($this->_content[$key]))
$this->_modified = true;
unset($this->_content[$key]);
$this->write();
}
/**
@@ -220,7 +218,6 @@ class CookieCore
$this->_setcookie();
unset($_COOKIE[$this->_name]);
$this->_modified = true;
$this->write();
}
/**
@@ -244,7 +241,6 @@ class CookieCore
unset($this->_content['id_address_invoice']);
unset($this->_content['id_address_delivery']);
$this->_modified = true;
$this->write();
}
public function makeNewLog()
@@ -320,6 +316,12 @@ class CookieCore
return setcookie($this->_name, $content, $time, $this->_path, $this->_domain, 0, true);
}
public function __destruct()
{
if ($this->_modified)
$this->write();
}
/**
* Save cookie with setcookie()
*/