Re: shopping cart remembers cart with COOKIES instead of SESSION?

From: Date: Sat, 02 Dec 2000 20:42:26 +0000
Subject: Re: shopping cart remembers cart with COOKIES instead of SESSION?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-28388@lists.php.net to get a copy of this message
You would've had to do some *extra* work, I think, to get PHP sessions to NOT use cookies
We just made it an object, a class, whatever you call it. A variable that travels with them as they go through the site. Tracked with a start_session(); thing at the top of each page.
You want the actual contents of the shopping cart to be in the cookie?
Nope...
Why not just make the session ID in a cookie and make the cookie's expiration date months in the future?
YEP! I've always avoided cookies and therefore didn't really know how to do that. But now that you say it so succinctly ("make the session ID into a cookie") - you're right - it doesn't sound that hard.
Yes, not everyone accepts cookies. Nor does everyone accept javascript. Not everyone uses the web.
Hahahaha - best closing statement to the "cookies or no cookies?" argument I've ever heard!
Cookies vs. no cookies?
The way I figure it, we've got the dee-lovely PHP4 on our side, so we can TRY to add a cookie, and track people that way, which can remember their cart items for months if need be. BUT if they don't have cookies enabled - no problem! --trans-sid to the rescue! Amazon does it this way, too. You can shop there without cookies, no problem. But if you DO have cookies, it's amazing how I can not go there for MONTHS and when I return... there are all the things I put in my cart last summer! I love it! It makes me say, "Oh yeeeeeeah! I never DID get that book!" Thanks for your help Michael. I'll bet it won't be that hard to add the cookie option to my sessionID storage.

« previous php.general (#28388) next »