1

For my device testing (iPhone Safari), multiple notifications pop on,

from the code message.js

initialize: function () {
        this._super();

        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', {});
        }

        $.cookieStorage.set('mage-messages', '');

        // $(window).on('beforeunload', function () {
        //     $.cookieStorage.set('mage-messages', '');
        // });

    }

Although I am setting mage-messages as empty at the end

$.cookieStorage.set('mage-messages', '');

Still, on the next reload the very first line of code gives me the old mage-messages message

$.cookieStorage.get('mage-messages')

This issue only prevails in iPhone safari, works fine in desktop safari and chrome.

How to resolve that issue, from where does that previous cookieStorage are getting set even if I am clearing it the at the end of my script.

And why does that issue only happening in iPhone device

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.