I am using $_SESSION variables to hold the logged user name thorughout the session, which I am sure is OK.
I am also using it to process the customer information submitted by the user like name, address, email.
Current Dilema
I am writing shopping cart variables to database, I need to access this for 'viewcart.php' and also at 'invoice.php' (view complete order with taxes and shipping). I am holding the cart total amount and number of items in cart as SESSION variables so that it can be displayed beside the view cart link at all times.
Question : is this a good way to design or is it better not write to database and just hold all the shopping cart info as SESSION variables? Is there a situation when you will do both? What do you think? What are the pros and cons?
thanks for your help