tags:

views:

148

answers:

2
A: 

The typical problem here is that there is no valid location for the session data to be stored set in the php.ini file (or with session_save_path), or there a insufficient permissions to save the info.

If you are using a hosting company, make sure to check their wiki on where they want the path set to. Some require you to have a sessions folder in your root that you use.

If it is a localhost setup, make sure that the web server has write access to the save path.

Cryophallion
A: 

Is register_globals on? I see that you have a 'cart' key in your session; you then set $cart to an empty array:

if (isset($_GET['cart']))
{
 $cart = array();
 $total = 0;
 foreach ($_SESSION['cart'] as $id)
 {
   ...

If globals are registered in your php.ini, this could cause your cart to be overwritten when this code is executed. Either turn it off or use different names.

More info about register_globals

Lucas Oman