Re: Shopping Carts
| From: | Chris Lee | Date: | Wed, 10 Jan 2001 17:13:37 +0000 |
| Subject: | Re: Shopping Carts | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33707@lists.php.net to get a copy of this message | ||
I use sessions combinded with utc
function mtime()
{
$mtime = microtime();
$mtime = ereg_replace('\.', '', $mtime);
$mtime = explode(' ', $mtime);
$mtime = $mtime[1] . $mtime[0];
return($mtime);
}
will ALLWAYS return a unique number, store this number in a session, each
user gets assigned a sessionID now each user has their own number, 100%
unique to themselves. this is how I seperate my users. Ive built quite a few
cart systems with this aproch. I store the cart right in the sessions, but I
have also set systems up where the cart is right in the db. I did the later
because a client wanted to have a way to see the % of users that put things
in their cart and never purchased, and % of products purchased to %
abandonded in their cart.
Your right on the IP system, here in the office I share the same IP with 12
people throught a NAT.
I dont know if you need to use an IP at all, if this is just for a cart...
then big deal, some script kiddy could try 36^32 possible combinations of a
PHPSESSID to try and hijack their cart ! haha. maybe for a something a
little more secure.
Chris Lee
Mediawaveonline.com
"Brandon Orther" <brandon@webintellects.com> wrote in message
news:CKEMJEADMOCEHPHJKLPAMEJECCAA.brandon@webintellects.com...
> Hello,
>
> I am making a shopping cart. I am wondering on how I should separate each
> user. I though the I.P. would be good but there can be a couple people on
> one I.P. so if someone is sharing an I.P. it will mess things up.. Anyone
> got a better way to do it?
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> brandon@webintellects.com
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>