Re: shopping cart question

From: Date: Sat, 02 Mar 2002 17:59:44 +0000
Subject: Re: shopping cart question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-86901@lists.php.net to get a copy of this message
Hmm I miss understood in the past how exactly php session handling was done. Thanks for the answer. Jon "Markas" <mark@e-net.lt> wrote in message news:20020302090543.5951.qmail@pb1.pair.com... > Why not use php's sessions, where php uses cookies for getting phpsessid, > and if no cookies are available, it automatically adds those id's to every > href (you can manage that in php's conf file) > > Jon Feldhammer <jon@apparel4sale.com> wrote in message > news:20020302024106.62677.qmail@pb1.pair.com... > > The way I see it, there are three options for maintaining state in php. > > I've already taken the route of keeping a random session id and putting it > > into a database to track a user/cart. So the only variable i need to > track > > is the session id. The three options I know of then are: > > > > 1. Putting the session id in the url > > 2. Putting the session id into a cookie > > 3. Putting the session id into a hidden input type and have every button > be > > a form > > > > Option 3 sucks asthetically and coding wise. Option 1 is somewhat ugly > > because now you have a big ole session id in your url (plus I don't think > > search engines like these). Also, with option 1 you need to have a <?php > > echo "?session_id=$session_id" ?> type line in every href which is a pain > in > > the ass. Option 2 is great, if the user uses cookies, if not, you cannot > > track the user at all. Anyone have the perfect solution? > > > > Thanks. > > > > Jon > > > > > > > > > >

« previous php.general (#86901) next »