0

I am trying to access my session or cookie variables on sub stores but didn't get any values there.I am trying like this :

 Mage::getModel('core/cookie')->set("foo","magento");
          $_COOKIE['foo'] = "magento";
          Mage::getSingleton('core/session')->setData("foo","magento");

When i try to access these variable on sub stores it returns empty result.I have created sub stores with multisite like http://example.com/ and http://example.com/secrondstore I have created addson domain that link second store like this http://secondstore.com/.May be different stores with addon have effect on this

Adda
  • 305
  • 5
  • 18

1 Answers1

0

Possible duplicate of : PHP – setcookie() not working

You will need to use PHP's built in method to set cookies: setcookie, then use $_COOKIE[]=''

setcookie('foo', 'magento',time()+3600*24);
$_COOKIE['cookie'] = 'magento';
Community
  • 1
  • 1
Ahmad
  • 12,336
  • 6
  • 48
  • 88
  • Thanks for your response.But still didn't accessible the cookie on other site.I am using magento and i think they are creating new session and cookies on loading. – Adda Feb 17 '15 at 05:20