I'm using Magento 2.0.2, I have this series of errors:
- In the Sign in page when I type in a wrong password I get redirected to the same page BUT I didn't see the expected "Invalid login" error message.
- After I log in, the top menu bar didn't update with the name of the customer and if I had items in my cart from previous sessions I didn't see the the amount in the little orange square to the right of the icon cart.
- If I add a product to the cart, then I get the message telling "You added xxx to your shopping cart" and ALSO I get the previous "Invalid login" error message. Additionally I get the items from previous sessions. BUT if I click on the cart icon and click on "Go to checkout" button I get the login popup…
- Then, if I go back to my dashboard, now the top menu bar shows the name of the customer and also I can go normally to the checkout process.
Any ideas? Thanks!
Best Answer
We had this same issue on our site. Clearing browser cookies would make it work for a while but obviously we couldn't expect customers to always clear their cookies for us. The problem is that it would make two separate session cookies for everyone who logs in. One for example.com and one for .example.com. (notice the dot in front that makes it apply to itself and all subdomains as well) We would get exactly the problem you would describe when these two cookies ended up pointing to different sessions after a while. It's a bug in magento and the work around was as follows:
Go to system -> configuration -> general -> web -> session cookie management Make sure the fields cookie path and cookie domain are correct. In most cases, cookie path should just be / and cookie domain should just be your domain name with a dot in front.