I'm using Magento 2.0.2, I have this series of errors:

  1. 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.
  2. 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.
  3. 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...
  4. 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!

  • All the error messages are stored in the corresponding var/session/sess_ file, but it seems that Magento is not processing them...
    – hiperboreo
    Feb 29, 2016 at 4:31
  • It would help if you can also mention the server environment such as if there is some third party cache configured on the instance. Sep 21, 2021 at 5:12

3 Answers 3


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.

  • I tried without success :( It's true that on system -> configuration -> general -> web -> session cookie management the fields you mentioned were empty. For cookie path I typed / , for cookie domain I wrote mine with the dot and I couldn't log in ether as admin neither as customer, accessing directly the table core_config_data I delete the dot in the front of the domain and I can login again. But the error still persists!
    – hiperboreo
    Mar 2, 2016 at 2:56
  • You will probably have to clear your cookies once after changing the cookie settings.
    – Christian
    Mar 2, 2016 at 20:22

Check your Magento 2 file permissions on the server, especially var/session/. Can your webserver user write to the folder? Is it in the right usergroup?

  • yes, the webserver can read and write to the folder var/session, yes it's in the right usergroup... I'v been tracking how the server access session files, I also thought it was a permission issue, but when I saw the server was writing and changing the content of session files I discard it. Thanks for your comment
    – hiperboreo
    Mar 2, 2016 at 2:39

I had exactly the same problems as you had and the same results with the advices on session cookie management settings. After reverting the setting in the database I decided to try to disable the Magento_Persistent module in Configuration -> Advanced -> Advanced and now the front-end behaves exactly like it should behave.

My guess is that somehow server side sessions are not synced well with client side cookies on opening a session so I just stick with client side cookies as I have no need to chase abandoned shopping carts.

  • Well, I did it, disable Magento_Persistent module, but I still have the same issue with the name in the top bar and with the items in the cart, same way to "solve it": going back to my dashboard to get logged in :(
    – hiperboreo
    Mar 7, 2016 at 1:24
  • Yeah, sorry, I found out later, too many bugs in 2.0.2. I'm now using the Dev version but due to another bug you might have to set the theme directly in the database. But as far as I can see the weird behavior and some other bugs are gone. Mar 8, 2016 at 2:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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