[thelist] shopping cart design (database or cookie?)

Chris W. Parker cparker at swatgear.com
Thu Jul 10 18:58:03 CDT 2003


Hi.

I'm trying to decide whether or not I should use a database to store the contents of a customers shopping cart or a cookie. The main dilemma is that of product prices. If I store the price in a cookie, to be retrieved during checkout, it's possible that the customer could hack the cookie to create any price they choose. If I don't store the price at all I must retrieve it fresh from the database at which point it's possible the price could have been changed by an adminstrator. The customer is going to be thrown off by the fact that when they added the product to their cart it was 5 bucks, but when they go to checkout it's 6 bucks.

The alternative would be to store the shopping cart information in a database which would allow the price to stay the same throughout their session and also not allow someone to change the price.

I also think a database would be easier to manage.

What do you think?

Thanks,
Chris.


More information about the thelist mailing list