I'm using Magento 2.4.2 on a website with multiple stores where I have :
- example.com/fr
- example.com/es
- example.com/us/en
- ...
My issue is when someone submit on the contact form, no success or error message is displayed, and the div that should contain it is empty (not a css issue).
Other messages such as add to cart success or bundle select option are well displayed on each stores.
I tried to debug it and I found something with cookies:
When going for the first time on example.com/fr/contact, I will have the cookie "mage_messages" with no value, 'example.com' as domain and '/fr' as path. When submiting, a new cookie "mage_messages" is created with the success message encoded as value, 'example.com' as domain and '/' as path. The first cookie "mage_messages" is same as before submitting
I tried to force set the encoded value in the cookie with path '/fr' and the messages appeared after refresh.
It seems that Magento is setting a cookie with wrong path, that cause the creation of a new one with the wanted value.
When the bug appeared, the "cookie path" config was empty. I tried to set it as '/' or '/fr' but it had no effect so I let it empty.
Could you please help me to find out what is happening?