I set up the cookie with
<?
// set cookie if not already set if (!isset($cusid)) { srand((double)microtime()*1000000); $randval = rand(); setcookie("cusid",$randval); }
?>
and then I unset it with
// unset cookie setcookie("cusid","");
But i do not get the cookie to be deleted, what is wrong?
try the following-- setcookie("cusid");
also, you must go to a different page. eg if you have deleted the cookie in file1.php then you must redirect to file2.php and see the cookie value(it wont be there). same applies for setting the cookie too, eg if u set a cookie in file1.php then the cookie will be present in file2.php (i hope u are getting what i mean to say)
cheers; nilesh
to delete a cookie reset the cookie without giving it any value.
ie...
//create cookie to last 1 hour setcookie ('name', 'value', time()+3600);
// test to see if cookie is set echo "$value";
//delete cookie setcookie ('name');