Skip to content

Commit 6c5246a

Browse files
committed
MC-36096: [Cloud] Local cache storage is not retained for the expected period.
1 parent 6a33719 commit 6c5246a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ define([
3030
url.setBaseUrl(window.BASE_URL);
3131
options.sectionLoadUrl = url.build('customer/section/load');
3232

33-
//TODO: remove global change, in this case made for initNamespaceStorage
34-
$.cookieStorage.setConf({
35-
path: '/',
36-
expires: 1
37-
});
38-
3933
storage = $.initNamespaceStorage('mage-cache-storage').localStorage;
4034
storageInvalidation = $.initNamespaceStorage('mage-cache-storage-section-invalidation').localStorage;
4135

@@ -220,6 +214,12 @@ define([
220214
this.reload(sectionConfig.getSectionNames(), true);
221215
$.cookieStorage.set('section_data_clean', '');
222216
}
217+
218+
var cookieExpires = new Date(Date.now() + parseInt(options.cookieLifeTime, 10) * 1000);
219+
$.cookieStorage.setConf({
220+
path: '/',
221+
expires: cookieExpires
222+
});
223223
},
224224

225225
/**

0 commit comments

Comments
 (0)