1. Comment out the line: print "Content-type: text/html\n\n"; 2. Find this: &require_supporting_libraries (__FILE__, __LINE__, "./Library/web_store.setup.frames.javascript"); # "./Library/web_store.setup.html"); and add this right under it: &require_supporting_libraries (__FILE__, __LINE__, "./Library/cookie.lib"); Make sure you put the cookie.lib file available from Matt Wright (http://www.worldwidemart.com/scripts/)in your Library directory. 3. Then find this: if ($cart_id eq "") { &delete_old_carts; &assign_a_unique_shopping_cart_id; } And replace it with this: if ($form_data{'cart_id'} eq "") { &GetCookies; if ($Cookies{'cart_id'} ne "") { $cart_id = $Cookies{'cart_id'}; } else { &delete_old_carts; &assign_a_unique_shopping_cart_id; &SetCookies('cart_id',"$cart_id"); } } else { if ($form_data{'order_form_button'} ne "") { &SetCookies('cart_id',""); } $cart_id = $form_data{'cart_id'}; } print "Content-type: text/html\n\n"; (I'll paste that section again with the commenting intact, I'm not sure if it will look right as it looks horrible in this text area.) if ($form_data{'cart_id'} eq "") { #Have a cart_id?? &GetCookies; #Get cookies if ($Cookies{'cart_id'} ne "") { #Valid cart_id cookie ?? $cart_id = $Cookies{'cart_id'}; #Set cart_id as the cookie } else { #No cart and no cookie &delete_old_carts; #Delete old carts &assign_a_unique_shopping_cart_id; #Get new cart &SetCookies('cart_id',"$cart_id"); #Set cookie as the cart_id } } else { #Already have a cart_id if ($form_data{'order_form_button'} ne "") { #Going to checkout &SetCookies('cart_id',""); #Clear the cart_id cookie } $cart_id = $form_data{'cart_id'}; #Still shopping } print "Content-type: text/html\n\n"; #Content header