You can add/update/delete any type of variable at anytime when you use php sessions. Here's a general take at what I'd do for an e-cart app. Firstly, I'd place all e-cart code in a separate file, that way you can include it in any file you want. (even better, you can make a class for it) include_ecart.php: (not checked for errors) <?php /* e-cart related functions */ function does_ecart_exist() { // if 'ecart' session variable is set, it exists return (isset($_SESSION['ecart'])); } function is_item_in_ecart($product_id) { // make sure the e-cart exists! if (!does_ecart_exist()) return (false); return (isset($_SESSION['ecart'][$product_id])); } function add_item_to_ecart($product_id, $product_name, $unit_price, $quantity) { // make sure the e-cart exists! if (!does_ecart_exist()) return (false); // todo: determine what to do if item already in cart... // if (is_item_in_ecart($product_id)) // update or return error? // create an array to hold the product data $product_data = array('name' => $product_name, 'price' => $unit_price, 'quantity' => $quantity); // add the product to the e-cart array, using it's id as the key $_SESSION['ecart'][$product_id] = $product_data; return (true); } function view_ecart_contents() { // make sure the e-cart exists! if (!does_ecart_exist()) return (false); // grab each item in the cart, and print out data $product_id = 0; $product_data = array(); while (list($product_id, $product_data) = each($_SESSION['ecart'])) { printf('Product Id: %1$s, Name: %2$s, Price: %3$s, Quantity: %4$s', $product_id, &n