Home Web Development Magento cart emptying
Magento cart emptying PDF Print E-mail
Written by Tom   

This normally happens suddenly if your hosting server had some update or or configuration setting or  a security setting was changed. We suspect a cookie setting issue on the hosting server or some patch on the hosting server affecting the cookie setting and session setting. We recommend first contacting your hosting provider to fix the server settings


Login to Magento Admin


Navigate to Configuration>Web>Session Cookie Management




Set cookie lifetime: 0 or 86400 or higher

Set cookie domain:  or or

Set cookie path: to "/" upon suggestion or leave it blank


For more info


Other related issues


After setting the above or setting Cookie lifetime to 86400 or 0 you are experiencing a login issue, where you cannot login, you may need to hack the core code (not recemmended till a last option).


Access the Varien.php file via FTP





For some older versions (older than Magento 1.9) comment out the lines below //  'domain'   => $cookie->getConfigDomain().



$cookieParams = array(

'lifetime' => $cookie->getLifetime(),

'path'     => $cookie->getPath(),

//'domain'   => $cookie->getConfigDomain()

//'secure'   => $cookie->isSecure(),

//'httponly' => $cookie->getHttponly()





New versions comment the bellow:


/* to solve login issue */

/*if (!$cookieParams['httponly']) {


if (!$cookieParams['secure']) {


if (!$cookieParams['domain']) {






if (isset($cookieParams['domain'])) {

$cookieParams['domain'] = $cookie->getDomain();*/


//I have commented these lines



For more info