diff --git a/module/product/model.php b/module/product/model.php index cdd297a104..0631a31a45 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -156,9 +156,10 @@ class productModel extends model $this->session->set('product', (int)$productID, $this->app->tab); if($productID && strpos(",{$this->app->user->view->products},", ",{$productID},") === false) $this->accessDenied(); - setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); } + setcookie('preProductID', (int)$productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); + if($this->cookie->preProductID != $this->session->product) { setcookie('preBranch', 0, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);