Handling a Shopping Cart

Hi all, just a quick one, what is the best way to deal with a shopping cart system. Should I create a temporary cart and add all of the items to that such as the sale price, normal price, title, description, etc or should I just store the product id in the temporary cart and use a JOIN to the products table.

Also, how do I put the users session-id into the database and I’m finding that their session id is changing on each page, hence losing the items they have added the shopping cart.

Any pointers or help would be appreciated as always :slight_smile:

I would give every user an id (the primary in the database)
And than make a table in the db like this:
|id| userid | productid | amount | … | …|

and select by userid, and join the table products and then send it to the user