且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何强制清除用户的缓存/cookie?

更新时间:2022-05-09 00:05:52

是.诱使用户选择适当的菜单项,以清除其cookie和缓存.我开玩笑!那将被称为社会工程"型黑客攻击,对于那些希望避免法律麻烦的人来说是不可取的.

Yes. Trick the user into selecting the appropriate menu item which clears their cookies and cache. I kid! That would be called "social engineering" type of hacking and is inadvisable for those wishing to stay clear of legal troubles.

根据您要执行的操作,有几个标签可能会有用:

There are a couple of tags that may be useful, depending on what you want to do:

<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Refresh" CONTENT=...time>

这仅控制您自己的网页,通常不控制缓存.当然,您可以将自己网站的Cookie设置为所需的任何内容.

This only controls your own web page, not the cache in general. Of course, you can set your own site's cookies to whatever you want.