diff --git a/module/VuFind/src/VuFind/Cart.php b/module/VuFind/src/VuFind/Cart.php
index 73279f91b4bb8c86d2dd25621644d55166f8270a..b23ebcfadf20c7897f0704af71d654e32aef0583 100644
--- a/module/VuFind/src/VuFind/Cart.php
+++ b/module/VuFind/src/VuFind/Cart.php
@@ -282,9 +282,20 @@ class Cart
 
         // Save the cookies:
         $cookie = implode(self::CART_COOKIE_DELIM, $ids);
-        setcookie(self::CART_COOKIE, $cookie, 0, '/');
+        $this->setCookie(self::CART_COOKIE, $cookie, 0, '/');
         $cookie = implode(self::CART_COOKIE_DELIM, $sources);
-        setcookie(self::CART_COOKIE_SOURCES, $cookie, 0, '/');
+        $this->setCookie(self::CART_COOKIE_SOURCES, $cookie, 0, '/');
+    }
+
+    /**
+     * Set a cookie (wrapper in case Zend Framework offers a better abstraction
+     * of cookie handling in the future).
+     *
+     * @return bool
+     */
+    protected function setCookie()
+    {
+        return call_user_func_array('setcookie', func_get_args());
     }
 
     /**
@@ -296,4 +307,4 @@ class Cart
     {
         return $this->recordLoader->loadBatch($this->items);
     }
-}
+}
\ No newline at end of file