voodish logo
Skip to: Content | Navigation | Site map

Magento cookie problem [fixed]

There can be quite a few reasons why Magento issues the “enable cookies” page, it is usually a slight server misconfiguration, but can sometimes be down to a caching system or incorrect admin settings. Firefox seems to be untainted by this problem and troopers on regardless. IE, Opera and Chrome however, seem to have issues.

As there are many ways this problem can present itself, I think it’s a good idea to run through what worked for us, and then other possible solutions if that doesn’t fix it for you.

1. Synchronize the system clock

These instructions are for CentOS 5.*; how to install and configure NTP under CentOS Linux 5 server to synchronize the system clock.

Login as the root user

Type the following command to install ntp

# yum install ntp

Turn on service

# chkconfig ntpd on

Synchronize the system clock with 0.pool.ntp.org server:

# ntpdate pool.ntp.org

Start the NTP:

# /etc/init.d/ntpd start

Now check whether this has solved the cookie problem…
If not, let’s keep trying with the following:

OR…

2. Change cookie lifetime

Go to: Admin Panel -> System -> Configuration -> General-> Web-> Session Cookie Management and change COOKIE LIFETIME to 5400
(5400 seconds=90 minutes)

OR…

3. Remove Cookie params

Quite a drastic measure, so make sure to comment out, rather than delete:
Go to: Magento Folder/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

and comment out the following that starts at about line 78 as you see below.

/*
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()
);
*/

I hoped that has helped you solve the Magento cookie problem, please leave a note to let us know how you get on. :)

Related Articles

Comments RSS Feed

8 Comments

  1. innovative info solutions October 26, 2010

    Thanks
    Searching about same issue for some days now.

  2. Go to Top of the page

  3. steward December 29, 2010

    Awesome thank you.
    This was an occasional hassle in 1.3, but once we upgraded to 1.4.2 it was a show-stopper. The NTP thing worked perfectly and I would never have dreamed up that. I owe you guys a doughnut.

  4. Go to Top of the page

  5. flguy February 28, 2011

    It worked for me slightly different: setting the COOKIE LIFETIME to 0 - zero and commenting out the Cookie Params. Thank so much for you help.

  6. Go to Top of the page

  7. Irwan May 17, 2011

    Thank you very much for your help. It (almost) saves my life!

  8. Go to Top of the page

  9. Tibi July 20, 2011

    Well, after hours spent on this issue I managed to solve it but in my case the issue was that the development server hostname that we were using had an underscore character in it (e.g. my_hostname.com). It seems it’s a well known fact that IE can’t store cookies if the hostname has underscore characters in it.

  10. Go to Top of the page

  11. Sean August 21, 2011

    @Tibi
    Heh, for once Microsoft followed a standard to the letter and it tripped you up.

  12. Go to Top of the page

  13. Vdub August 23, 2011

    Magento 1.5.1.0 & Chrome cookie issue. Solved by using the 2nd solution, change cookie lifetime to 5400

  14. Go to Top of the page

  15. Alex December 27, 2011

    thank you, I somehow changed my frontend admin Cookie Lifetime to 1, therefore not allowing me to edit anything in backend without having to log back in. This fixed my problem, cheers!

  16. Go to Top of the page

Leave a comment