从浏览器中删除Cookie? [英] Delete cookie from browser?

查看:208
本文介绍了从浏览器中删除Cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有完全指示Web浏览器的任何删除一个人的饼干用PHP设置?

Is there any way of instructing a web browser to completely delete one's cookie set with PHP?

我不想要的终止的它,或者等待浏览器中的关闭

I do not want to expiry it or wait for the browser to be closed.

通过删除我的意思是实际上没有它cookie的名单里列出​​了。

With delete I mean to actually not have it listed inside the cookie's list anymore.

推荐答案

您不能强制浏览器中删除任何Cookie相关联的文件,因为你不能保证居然有这样一个文件 - 浏览器和Web服务器之间的合同关于饼干是数据将在符合条件的申请psented $ p $。

You cannot force the browser to delete the file associated with any cookie, because you can't guarantee there's actually such a file - the contract between browser and web server regarding cookies is that the data will be presented at eligible requests.

您说明您不想等待饼干过期,但cookie有效期是表示数据不再需要,不应该psented未来的请求$ P $,正确的方法,在大多数情况下,不转换到浏览器除去文件

You state that you "don't want to wait for the cookie to expire", but cookie expiration is the correct method for indicating that the data is no longer needed and should not be presented on future requests, which in most cases does translate to the browser removing the file.

要删除Cookie,因此,设置其过期时间过去。在PHP中,这是与 的setcookie()

To delete a cookie, therefore, set its expiration time into the past. In PHP, this is done with setcookie().

这篇关于从浏览器中删除Cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆