Leggere il manuale e gli esempi gentilmente postati da neroux no eh?!?!
Da manuale:
codice:
Example #1 setcookie() send example
<?php
$value = 'something from somewhere';
setcookie("TestCookie", $value);
setcookie("TestCookie", $value, time()+3600); /* expire in 1 hour */
setcookie("TestCookie", $value, time()+3600, "/~rasmus/", "example.com", 1);
?>
codice:
Example #2 setcookie() delete example
When deleting a cookie you should assure that the expiration date is in the past,
to trigger the removal mechanism in your browser.
Examples follow how to delete cookies sent in previous example:
<?php
// set the expiration date to one hour ago
setcookie ("TestCookie", "", time() - 3600);
setcookie ("TestCookie", "", time() - 3600, "/~rasmus/", "example.com", 1);
?>