WilliamMute007
Programmer
Hi all,
I wonder if anyone can render a bit of help please. I have a piece of Session code that I have been using for a while now. It seems to work fine on windows sever but on Apache I seem to be having problem. I have the following code
The aim of this code is to start a session with a random unique session ID which is then entered into a cart then later, the value of the cart is then called based on the set session id matching a session id in my cart table.
The problem am having now is that, when the session is sent to the DB Table, each time it seems to be setting a Unique ID within one user session. So basically if a user tries to add 2 Items into the shopping cart within a min interval, that user is being given two different session ID. It looks like the session ID is changing eveery second so mysql never returns any result as my current session never matches a session id on the table.
Any Help please?
Thank you in advance
I wonder if anyone can render a bit of help please. I have a piece of Session code that I have been using for a while now. It seems to work fine on windows sever but on Apache I seem to be having problem. I have the following code
Code:
if(!isset($HTTP_COOKIE_VARS['cart_id'])) {
$cart_id = md5(uniqid(rand()));
setcookie("cart_id", $cart_id, time() + 14400);
} else {
$cart_id = $HTTP_COOKIE_VARS['cart_id'];
}
The aim of this code is to start a session with a random unique session ID which is then entered into a cart then later, the value of the cart is then called based on the set session id matching a session id in my cart table.
The problem am having now is that, when the session is sent to the DB Table, each time it seems to be setting a Unique ID within one user session. So basically if a user tries to add 2 Items into the shopping cart within a min interval, that user is being given two different session ID. It looks like the session ID is changing eveery second so mysql never returns any result as my current session never matches a session id on the table.
Any Help please?
Thank you in advance