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

Gary McPherson genyus at ingenyus.net
Thu Jul 10 22:36:36 CDT 2003


> 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.
<snip>
> What do you think?

If you do decide to use cookies to store the cart contents, you should
only retain the minimal necessary data - ie the product keys. When the
checkout process is started, you just pull the relevant information back
from the database and then you have no worries about a customer hacking
a cookie as the most they can do is change the products they're
ordering, which makes not a blind bit of difference to the client. Also,
if the price changes between sessions, so what? They go and look in the
catalogue, the prices matches the one in their checkout - no arguments.

But regardless of all this - as has already been suggested, go for a
database. It's a more robust, flexible solution.

Gary




More information about the thelist mailing list