7

There is a reasonably common & well documented cookie-related bug/issue with Magento and Chrome (looking at the others' issues - possibly WebKit and IE at times). Whether this is due to a common Chrome extension/setting or incorrect web server setting - I do not know.

I'm on OS X 10.8.2 running CentOS 5.8 via VirtualBox. More often than not, for me to login to a Magento admin, I need to set the HTTP Only setting in the Magento admin to 'No'. Before I do this, I am not able to login via Chrome - other browsers do not seem to have this issue for me.

Now I've come across a new (but probably the same) issue while making an extension - I am able to read cookies via Chrome but not set them. There were no issues with using Firefox. To make sure it's not my Chrome, I've performed a fresh install by deleting all user data and profiles but the issue persists. Perhaps I should set the cookies via JS only for this extension.

Nothing out of the norm with the cookie setting code:

$cookie = Mage::getModel('core/cookie');
$cookie->set('cookiename','cookievalue',99999);
  • This should only affect you when you are running under localhost - or are you having problems in the production environment? – mpaepper Feb 18 '13 at 9:10
  • @mpaepper localhost only – Francis Kim Feb 18 '13 at 13:40
11

Don't develop using localhost as your domain name. I typically use apache to setup a fake custom site at a domain like magento.dev, and then add

127.0.0.1    magento.dev

to my hosts file. Beyond working around the cookie problem, this also lets me have an infinite number of sites running locally.

  • Yes I did have that - except my top level domain was .fk for my initials and Chrome did not like that. When this was changed to .local the issue was resolved. – Francis Kim Feb 18 '13 at 22:16
3

Is your server time and computer time correct? This causes the majority of cookie issues with Webkit based browsers - whereas IE and FF are far more tolerant (ignorant).

  • 1
    Not really considered an answer – Rick Kuipers Feb 18 '13 at 15:17
1

Turns out that Chrome interprets your custom web address differently from other browsers. I had a custom top level domain for my local installations but when this was changed to .com the issue was resolved and now it's set as .local (I was using .fk previously)

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.