-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session messages not removed properly - persist across multiple requests #10107
Comments
Same behavior here (message won't go away), also with success messages on default M2 2.1.7 with sample data, tested on Chrome and Firefox. You click "Add to Cart" on product page, submit (not ajax on default 2.1.7), you end up back on product page + success message. When you navigate away from product page, or refresh product page, you'll get same message again. That is, if messages.js is executed before review ajax comes back as @epson121 explained, which happens most of the time. For the same reason, sometimes if you click Add to Cart multiple times, success messages are stacking :) |
HI @epson121. I cannot reproduce this issue. Please add more details to your description of the steps you followed when identifying this issue. Screenshots, video or logs would be helpful, too. |
Hi all, I am also facing the same issue in Magento 2.1.7. Here is the video link for reproducing this issue. https://www.useloom.com/share/0c7a9812101c44a3b61f259fb0a3f39c |
Hi, @sabarivenkatesankrish. Unfortunately, I could not reproduce the issue as you described it. |
Hi, @1408sheva. I just installed Magento 2.1.7 package from repo.magento.com through the composer. I have also installed sample data. Apart from this, I did nothing. I have disabled the cache for ensuring the cache issue. I changed the session storage to "db" instead "files". But Still this exist. As of my knowledge it might not be a cache related issue. It could be a session related issue. I am not sure that the problem with the package. It may be from my end. But I can't able find. Any suggestion would be appreciated. |
@epson121, thank you for your report. |
I have resolve isssue from below referance link: I was using
for the javascript validation.
|
Need to flush and enable cache. |
I still have this bug in 2.4.2 Enterprise |
I also still have the issue in Magento 2.4.2-p1 Enterprise. The solution provided by @talalus worked for me. |
i'm already added this line before that's why it works fine in desktop, but I don't know why it didn't work on mobile devices(not emulator) |
This seems to be still valid in 2.4 commerce...any updates ? |
Preconditions
Magento CE 2.1.5 (experienced in 2.1.7 as well) with sample data in Google Chrome
Steps to reproduce
Expected result
Message "We don't have as many ... as you requested" should not be displayed on the next request
Actual result
Message "We don't have as many ... as you requested" is displayed on the next request
Workflow that causes this issue:
vendor/magento/module-checkout/Controller/Cart/Add.php:149
), and a cookie "mage-messages" is set with message: "We don't have as many ... as you requested"vendor/magento/module-theme/view/frontend/web/js/view/messages.js
script is triggered on frontend, and "mage-messages" cookie is clearedvendor/magento/module-theme/Controller/Result/MessagePlugin.php:82
, "mage-messages" cookie value is returned as received which causes "mage-messages" cookie to revert back to the state where it contains a message.So basically we have a race condition where cookie is set (with message), then it is removed via messages.js script, and then again set by returning XHR response that was sent before cookie was removed.
Workaround:
copy
vendor/magento/module-theme/view/frontend/web/js/view/messages.js
to your theme file, and at the end of initialize function add:The text was updated successfully, but these errors were encountered: