CubeCart empty cart issue

CubeCart empty cart issue

, on February 09, 2011
CubeCart empty cart issue

While working on a CubeCart (4.3.8) a weird issue appeared (customers add an items to their cart and then go to checkout and the items have disappeared).

The solutions posted on the CubeCart forums didn't work on my case so i analyzed a bit the problem and found out that on the process of adding a product to the cart a third party module was setting another value to the "CC_SESSION_NAME" cookie, so practically the user was sending the product to another session id while he was still using the old cookie.

Anyway, i solved the problem by modifying a line in ini.inc.php

After the line "/************* END INITIAL SECURITY CHECKS *************/" you will find some lines handling the session cookie

if (!empty($_GET[CC_SESSION_NAME])){
	$GLOBALS[CC_SESSION_NAME] = $_GET[CC_SESSION_NAME];
	
} else if (!empty($_COOKIE[CC_SESSION_NAME])){
	$GLOBALS[CC_SESSION_NAME] = $_COOKIE[CC_SESSION_NAME];
}

if (!empty($_GET[CC_ADMIN_SESSION_NAME])){
	$GLOBALS[CC_ADMIN_SESSION_NAME] = $_GET[CC_ADMIN_SESSION_NAME];
	
} else if (!empty($_COOKIE[CC_ADMIN_SESSION_NAME])) {
	$GLOBALS[CC_ADMIN_SESSION_NAME] = $_COOKIE[CC_ADMIN_SESSION_NAME];
}

In my case I solved the problem by changing the line:

$GLOBALS[CC_SESSION_NAME] = $_COOKIE[CC_SESSION_NAME];

with:

$GLOBALS[CC_SESSION_NAME] = $_COOKIE['PHPSESSID'];

I hope it helps someone.

Anonymous's picture

Which mod was making the bad assignment? It would be best to fix that mod, if possible. Barring a mod fix, it would help the rest of us to know so we can verify whether we have this problem.


Anonymous's picture

Ours was caused by Sherpa module by Summergrand Software


Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.