Skip to content

Instantly share code, notes, and snippets.

@Vinai
Created September 9, 2011 10:32
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Vinai/1205913 to your computer and use it in GitHub Desktop.
Save Vinai/1205913 to your computer and use it in GitHub Desktop.
Bug with store cookie handling in Magento up to 1.6 if specifying a non-default store MAGE_RUN_CODE
--- a/app/code/core/Mage/Core/Model/App.php
+++ b/app/code/core/Mage/Core/Model/App.php
@@ -511,11 +511,7 @@ class Mage_Core_Model_App
if ($this->_currentStore == $store) {
$store = $this->getStore($store);
- if ($store->getWebsite()->getDefaultStore()->getId() == $store->getId()) {
- $this->getCookie()->delete(Mage_Core_Model_Store::COOKIE_NAME);
- } else {
- $this->getCookie()->set(Mage_Core_Model_Store::COOKIE_NAME, $this->_currentStore, true);
- }
+ $this->getCookie()->set(Mage_Core_Model_Store::COOKIE_NAME, $this->_currentStore, true);
}
return $this;
}
@alancwoo
Copy link

alancwoo commented Aug 6, 2013

Has this been fixed in 1.6+?

I'm having a massive headache trying to manually override the store cookie. It never seems to pull from anything but the cookie that is set (which causes issues by not reading the cookie until the second reload)

Even implementing the above diff doesn't seem to help in my situation:

http://stackoverflow.com/questions/18068999/magento-and-wordpress-synchronizing-menu-across-both-platforms-issue-with-coo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment