We have a multi site/store which is on a subdomain level (Magento v1.14.1.0):


Logging in without the main.com frontend cookie enables the login in store1.main.com. However, if main.com is visited, another frontend cookie is created with the same value of the other store cookie.

frontend | somehashvalueofthecookie | .main.com
frontend | somehashvalueofthecookie | .store1.main.com

I tried to set the value in Cookie Domain setting in Magento Admin > General > Session Cookie Management per store but it does not have an effect.

There's an accepted answer here Can't login to second store on subdomain but it didn't do the trick. I already removed the third-party extensions.

Any idea? Thank you.

  • set cookie domain as .main.com in system configuration – MeenakshiSundaram R Jun 22 '15 at 2:57
  • That is the reason why store1.main.com as part of main.com. store1.main.com should have an exclusive cookie/session, and main.com should not interfere in store1.main.com. Setting just "main.com" didn't do the trick, as stated in my last statement. – user1240207 Jun 22 '15 at 3:03
  • How are you setting up the multi-store at the entry index.php levels may help shed some light on the issue as it should work as you have mentioned. – B00MER Oct 7 '15 at 18:22
  • This is why people who plan for the future tend to use www for the main site, it helps alleviate having to deal with this kind of nonsense. – Fiasco Labs Mar 20 '16 at 19:52

The cookies created for main.com are acting as wildcard (*.main.com) and either merging or overwriting other sub-domain cookies.

You will have to use www.main.com for your main site

  • 1
    No if you change the cookie domain of the main store to main.com instead of .main.com should do the trick. as long as you delete all cookies beforehand – Fabian Blechschmidt Jun 22 '15 at 5:22
  • I did that @FabianBlechschmidt. Unfortunately, the frontend cookies for both stores are always having the same value, and the domains are always .main.com, and .store1.main.com even if I set the Cookie Domain per store in the Session Cookie Management setting. This can be reproduced in a fresh install of Magento Also cleared the cookies to make sure it should take effect. – user1240207 Jun 22 '15 at 6:12
  • Either this is a bug or your make something wrong. If it is a bug, I would send it to magento and fix it, should be done easily=? – Fabian Blechschmidt Jun 22 '15 at 16:46

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.