View Single Post
Old 08-04-2005, 08:44 PM   #1 (permalink)
metazai
Regular Contributor
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 124
metazai is on a distinguished road
PHP Cookie problem

I must be missing something. Can anybody see why this isn't displaying the results of the cookie, and is not in fact seemingly created at all:

Code:
<?php 
 if(isset($_COOKIE['cart_id'])) { 
     $cart_id = $_COOKIE['cart_id']; 
	  } else { 
     $cart_id = md5(uniqid(rand())); 
     setcookie("cart_id", $cart_id, time() + 3600); 
}

echo ($_COOKIE['cart_id']); ?>
I'm stumped.
metazai is offline   Reply With Quote