IMHO, this is a poor way to manage a shopping cart simply because you pass the entire cart around in session. This can become problematic (outside of the problme you are having) and cause your server preformance to grind because you are storing all of that information in session. (Consider 10000 users at your site all at once with shopping carts that each contain 30 unique items consider still, if the user doesnt log out and just leaves the page, the application will hold onto that session in memory until the session timesout.)
You are already storing the information in a database, I would suggest that you keep the cart there and just pass a cartID around in session that relates back to a row in your database, this is much more effecicent.
In so far as why your session is being lost, I can't see anything that stands out, I might suggest stepping through your code to see what the compiler is doing.
hth.
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature
|