public function removeProduct($id) { if (!Session::containKey('cart') || !array_key_exists($id, Session::get('cart'))) { throw new \Exception('This products dont exist in your cart', 500); } unset($_SESSION['cart'][$id]); Redirect::to('/user/cart'); }