Re: odd cookie behaviour

From: Date: Sun, 08 Apr 2001 00:42:03 +0000
Subject: Re: odd cookie behaviour
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47614@lists.php.net to get a copy of this message
I think you might wanna check if $cookie is set, not $cookie[0], if that doesn't work just check if $cookie[0] = 0 -Shaun On Saturday 07 April 2001 21:10, matt thompson wrote: > hey, > > i'm designing a small shopping cart w/ cookies where the cookie is used as > an array (the array id being the product id) and the array value being the > number of items selected. anyways, for the most part everything works > fine, but with certain items if they're added to the cart, they get added, > but unfortunately do not display in the cart until a few other items are > added (the quantity of that product continues to increase regardless of > whether or not it's shown in the cart). i have absolutely no idea why this > is happening, and feel like i've tried most things that have come to mind. > my cookie is being set like: > > if (!isset($cookie[0])) setcookie("cookie[0]", "0"); > > i do not have a product w/ id of zero (0), so i use that as the default id > / value to set the cookie with. any suggestions _at_all_ would be > appreciated. :) > > thanks, > matt

« previous php.general (#47614) next »