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?

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

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

], function ($, Component, _, customerData) {
    'use strict';

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

    /** @inheritdoc */
    initialize: function () {

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

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

Your Answer

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

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