Come on guys can someone help me out here, I am really struggling.
I have set my cookie in one page and inserted the cookie value in the database using:
if (!isset($user_id)) {
$user_id = md5(uniqid(rand()));
setcookie("user_id",$user_id,time()+86400,"/",".digitalbeatbox.com");
}
At the next page I then want to read the cookie and the products it has got associated with it, using the code above on the next page I cannot return any values.
The cookie value (user_id) has been inserted in to the database, but trying to read it again I cannot get them to match.
I think this is because the values haven't been passed between pages and when I run the next page it creates a new value.
How can I get round this??