Page is a not externally linkable
LifeinAsia - 5:30 pm on Sep 20, 2012 (gmt 0)
Instead of dumping a cart when the user closes the browser or the session ends, it's a much better user experience to allow the cart to be saved. Several sites I frequent maintain the items in my cart for many days or even weeks. Other sites allow users to save their carts for even longer. I believe Dell expires saved carts after 30 days or so.
My suggestion would be to save the cart info to your DB and use a cookie or session variable to identify the cart in your DB (instead of saving everything in the cart in a cookie or session variable). Have an automatic processes to clean up your Carts table and return items to active inventory if the cart has been inactive for whatever period of time you decide to use.
You may want to use different time frames for different items. For example, if you have thousands of pieces of one item in stock, you could use a longer window than for something with only 1 or 2 pieces left in stock.
Of course, you should notify your users of the time frame for cart/item expiration. For the low inventory items, something like "This item is in high demand, so will be returned to inventory automatically in 2 hours if you do not complete your checkout by then."