Deleting Cookies
<?php
setcookie ( "cookie_user", "test", time () + 60 * 60 * 24 * 30 );
setcookie ( "cookie_pass", md5 ( "test" ), time () + 60 * 60 * 24 * 30 );
function logout() {
setcookie ( "cookie_user", "", time () + 60 * 60 * 24 * 30 );
setcookie ( "cookie_pass", "", time () + 60 * 60 * 24 * 30 );
}
logout ();
echo $_COOKIE ['cookie_user'] . "<br />";
echo "You have successfully logged out.";
?>
Related examples in the same category