I am deleting the mage-messages cookie, how sometimes it's not getting deleted for iPhone Safari browser. I have even added set timeout for 5 sec. The issue is the notification persists on other pages too. The reason is the mage-messages cookies doesn't get cleared and if it does get cleared it somehow get set even after the 5-sec timeout.
this.cookieMessages = _.unique($.cookieStorage.get('mage-messages'), 'text')[_.unique($.cookieStorage.get('mage-messages'), 'text').length-1]; this.messages = customerData.get('messages').extend({ disposableCustomerData: 'messages' }); if (!_.isEmpty(this.messages().messages)) { customerData.set('messages', {}); } setTimeout(function() { YX_UI_UTIL.eraseCookie("mage-messages"); }, 5000); It's not working, even after the 5-sec timeout, I think, mage-messages is still getting set.
So is there any listener when mage-messages cookie is set. so that I can clear the cookie when it set even after the 5-sec timeout.
Even when the mage-messages cookies are not cleared, I cleared it from the browser console while debugging and it worked. The notification messages don't persist on other pages.