1

The customers can't login, Magento return a 302 found response

Error trying to login

The admin can login without problems.

And I can't add products to cart, Magento returns a 302 found response.

I already do:
Clean cache "magento cache:clean"
Flush cache "magento cache:flush"
Compile "magento setup:di:compile"
Reindex "magento indexer:reindex"

I try to create a new customer and it works, the customer was created without problems, but when I try to add a product isn't work.

  • Don't try to use localhost as a Top Level Domain. – Khoa TruongDinh Nov 10 '16 at 16:51
3

Don't try to use localhost as Top Level Domain(TLD). That may cause your current issues: can't login and add product to cart. We can choose some domains like: mage.loc, mysite.loc,.. If you're are using Apache on Windows, you can follow this guide: http://foundationphp.com/tutorials/apache_vhosts.php to create a Virtual host.

  • I don't think that is the problem, I was debugging the Magento 2 code and the problem i found is, the formKey is allways diferent. How can i fix that. – allamgr Nov 10 '16 at 19:07
  • 1
    I faced the same problem while using localhost as domain name. After changing the domain it is working. – Saravanan DS Nov 21 '18 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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