Hello @yagnik_solanki1
After deleting a cookie record called "mage-messages", The old message won't be shown again.
I used the following code to remove it programmatically
... private $_cookieManager; ... public function __construct( ... \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager ) { ... $this->_cookieManager = $cookieManager; } ... private function _deleteMessage() { $this->_cookieManager->deleteCookie('mage-messages'); } ...
I hope this solution will help you
Hello @yagnik_solanki1
After deleting a cookie record called "mage-messages", The old message won't be shown again.
I used the following code to remove it programmatically
... private $_cookieManager; ... public function __construct( ... \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager ) { ... $this->_cookieManager = $cookieManager; } ... private function _deleteMessage() { $this->_cookieManager->deleteCookie('mage-messages'); } ...
I hope this solution will help you
Hello @yagnik_solanki1 ,
After deleting a cookie record called "mage-messages", The old message won't be shown again.
I used the following code to remove it programmatically
... private $_cookieManager; ... public function __construct( ... \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager ) { ... $this->_cookieManager = $cookieManager; } ... private function _deleteMessage() { $this->_cookieManager->deleteCookie('mage-messages'); } ...
I hope this solution will help you
Hello @yagnik_solanki1 ,
After deleting a cookie record called "mage-messages", The old message won't be shown again.
I used the following code to remove it programmatically : -
... private $_cookieManager; ... public function __construct( ... \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager ) { ... $this->_cookieManager = $cookieManager; } ... private function _deleteMessage() { $this->_cookieManager->deleteCookie('mage-messages'); } ...
I hope this solution will help you
Hello @yagnik_solanki1 ,
there is a cookie record called "mage-messages". After deleting it, the old message won't be shown again.
@syedkamranef82 Where to add this code, from where and when to call this function
I had the same problem, so I found out it is not a good idea to change a cookie with js that you initially created with PHP, so I developed a GraphQL API that deletes the message cookie. I called this API with jquery in messages.js where you usually would set mage-messages "", and it worked.