6

I am facing a problem, when customer enters incorrect username/password, error message appears below the navigation bar which does not disappear even after refreshing the page. When the customer navigates to another page, that message shows on that page too. Another thing, when the customer enters multiple times incorrect username/password then this error message list increases.

My cache is enabled and mode is default. What to do now?

2
  • What is your exact magento2 version ? Please try upgrading to the latest version of Magento
    – MGento
    Commented Oct 25, 2017 at 10:00
  • I am using Magento v2.1.6
    – umair ayub
    Commented Oct 25, 2017 at 10:12

1 Answer 1

3

Update messages.js in vendor/magento/module-theme/view/frontend/web/js/view.

define([
    'jquery',
    'uiComponent',
    'underscore',
    'Magento_Customer/js/customer-data',
    'jquery/jquery-storageapi'
], function ($, Component, _, customerData) {
    'use strict';

return Component.extend({
    defaults: {
        cookieMessages: [],
        messages: []
    },

    /** @inheritdoc */
    initialize: function () {
        this._super();

        this.cookieMessages = $.cookieStorage.get('mage-messages');
        this.messages = customerData.get('messages').extend({
            disposableCustomerData: 'messages'
        });

        if (!_.isEmpty(this.messages().messages)) {
            customerData.set('messages', {});
        }
        setTimeout(function(){
             $.cookieStorage.set('mage-messages', '');
        },3000);
    }
}); });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.