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
- 17.09.12: Import Export sql database the easy way via SSH (0)
- 21.06.12: An A-Z Index of the Bash command line for Linux. (0)









Comments RSS Feed



Thanks
Searching about same issue for some days now.
Go to Top of the page
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.
Go to Top of the page
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.
Go to Top of the page
Thank you very much for your help. It (almost) saves my life!
Go to Top of the page
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.
Go to Top of the page
@Tibi
Heh, for once Microsoft followed a standard to the letter and it tripped you up.
Go to Top of the page
Magento 1.5.1.0 & Chrome cookie issue. Solved by using the 2nd solution, change cookie lifetime to 5400
Go to Top of the page
i use the 2nd solution, set it to 20 years. but the problem still exist. It normal happened to 1st register customer. After logout and try to login again, it will redirect back to login page without any errors…
Go to Top of the page
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!
Go to Top of the page
Solution #3 is a real lifesafer!
Thanks a lot!
Go to Top of the page
thank god, you saved my live! I’d never have thought a time diff would be the issue
Go to Top of the page
Thanks mate!
Go to Top of the page
Awesome…!!!
Option #3 worked for me.
Thanks a lot…!!!
Go to Top of the page
magento comunity 1.7.0.2
Comment the line
call_user_func_array(’session_set_cookie_params’, $cookieParams);
Line 108~
in file app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
Go to Top of the page
“Synchronize the system clock” solution helped me. Thank you for great tutorial.
S.
Go to Top of the page
The 3rd option saved my ass
Go to Top of the page
Thanks a Ton!! Remove Cookie params worked for me…but what might be the cause for the problem?
Go to Top of the page