NYCPHP Meetup

NYPHP.org

[nycphp-talk] Saving Items for Later in a Shopping Cart

csnyder chsnyder at gmail.com
Tue Dec 14 09:22:14 EST 2004


On Tue, 14 Dec 2004 09:09:39 -0500, Randal Rust
<rrust at r2communications.com> wrote:
> Now I am thinking that I will have to use a cookie, but even then, how
> do I ensure that the customer sees the correct items when they return?

Since you're right about the session going away, you'll need to use a
database to store the items, under an id that you can put into a
cookie for when they come back. The items aren't stored in the cookie,
only the reference to the cart.

A bonus to this approach is that you can also mark the cart with a
userid, so that if they start shopping from home, but then log in at
work to complete the transaction, they can pick up where they left
off.

-- 
Chris Snyder
http://chxo.com/



More information about the talk mailing list