当我想删除 Cookie 时,我会尝试
When I want to remove a Cookie I try
unset($_COOKIE['hello']);
我在 Firefox 的 cookie 浏览器中看到 cookie 仍然存在.我怎样才能真正删除 cookie?
I see in my cookie browser from firefox that the cookie still exists. How can I really remove the cookie?
你可以试试这个
if (isset($_COOKIE['remember_user'])) {
unset($_COOKIE['remember_user']);
setcookie('remember_user', null, -1, '/');
return true;
} else {
return false;
}
这篇关于删除一个 cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!