2

I have my development site in

http://localhost/mydevsite/

Everything is working fine, until I tested it in IE browser. When I click add to cart button (no changes made to this functionality), it gets redirected to cart page, but the cart is empty.

In other browsers, it is working fine. I use IE 10, also tested in IE9, IE8, IE7 (checked using the Browser Mode option). The problem prevails. I checked with both Magento CE and EE.

Is there a problem with IE settings, so that localhost websites doesn't hold cookies or something like that? Can anyone help me on this?

EDIT: sorry I forgot to mention, I don't have permissions to edit hosts file, otherwise I could have created a virtual domain. If other browsers can add products to cart, why not IE? I remember I have used loclhost in IE sometime back and it worked.

  • as suggested by Marius, this link gives me good fix – Shathish Jul 4 '13 at 8:57
5

Don't use localhost as you host. For some reasons Magento needs a dot . in the host in order to be able to store cookies. Use 127.0.0.1 or add to hosts something like

magento.local    127.0.0.1

and use magento.local as your host.
You will need to change the base_url in core_config_data in order to make it work.
[EDIT]
This may offer a solution. It involves changing the way that the cookies are validated.

  • sorry I forgot to mention, I don't have permissions to edit hosts file, otherwise I could have created a virtual domain. If other browsers can add products to cart, why not IE? I remember I have used loclhost in IE sometime back and it worked. – Shathish Jul 4 '13 at 8:27
  • 1
    I always had problems when using localhost for version 1.2+. I usually work with 127.0.0.1 and it works great. You can also check the IE settings. Maybe you are not allowed to set cookies. Edit: Check this also: stackoverflow.com/questions/15639199/… – Marius Jul 4 '13 at 8:35
  • as suggested by Marius, this link gives me good fix – Shathish Jul 4 '13 at 8:44
  • Great. I added it to the answer also. – Marius Jul 4 '13 at 9:49

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.