diff --git a/app/code/Magento/Cookie/view/frontend/web/js/notices.js b/app/code/Magento/Cookie/view/frontend/web/js/notices.js index d7f0fa3874756..0b526ca5c27e3 100644 --- a/app/code/Magento/Cookie/view/frontend/web/js/notices.js +++ b/app/code/Magento/Cookie/view/frontend/web/js/notices.js @@ -20,7 +20,10 @@ define([ $(this.options.cookieAllowButtonSelector).on('click', $.proxy(function() { var cookieExpires = new Date(new Date().getTime() + this.options.cookieLifetime * 1000); - $.mage.cookies.set(this.options.cookieName, this.options.cookieValue, {expires: cookieExpires}); + $.mage.cookies.set(this.options.cookieName, JSON.stringify(this.options.cookieValue), { + expires: cookieExpires + }); + if ($.mage.cookies.get(this.options.cookieName)) { window.location.reload(); } else {