Skip to content

Commit

Permalink
Backport PR-9713 for Magento 2.1 - stringify cookie value to fix #5596
Browse files Browse the repository at this point in the history
(cherry picked from commit a4daf56)
  • Loading branch information
bka authored and hostep committed Sep 2, 2017
1 parent 6065b1c commit dc79eb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/code/Magento/Cookie/view/frontend/web/js/notices.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit dc79eb7

Please sign in to comment.