Monday, September 29, 2008

How do I destroy cookies

Goodday Everybody, I set cookie by using the codes below

<?php
$cookie_expire = time()+3600;
$cookie_name = "users";
$cookie_value = "$_POST[f_name] $_POST[s_name]";
$ret = setcookie('users', $cookie_value, $cookie_expire, "/");if (!
$ret)
{
echo "Unable ot set cookie";


}


?>

and the cookie was actually set and are working as espected but I am
trying to destroy the cookie using the codes below.


<?php
setcookie('users', 'NULL', mktime()-10000, '/');
?>


but it is not destroying the cookies. Please I need your help
because
I am using the cookies for users authentation.


I am using the cookie to check if users logged in properly.


Thanks


Damelinks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: