Opera 浏览器的 javascript - 删除会话 cookie 和重新加载页面
我希望可以为 Opera 编写一段简单的用户 javascript,它将:1)立即删除/使所有当前会话 cookie 过期,2)完成后重新加载当前页面。
此外,我希望能够使用自定义 Opera 按钮触发此脚本。预先感谢您的任何建议。
I'm hoping that it's possible to write a simple bit of user javascript for opera which will: 1) immediately delete/expire all current session cookies and 2) reload the current page after that has been done.
Additionally, I'd like to be able to trigger this script with a custom opera button. Thanks in advance for any suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是不可能的——或者至少不可能有通用的解决方案。原因是许多网站将其会话 cookie 标记为“httpOnly”,这意味着您无法从 JavaScript 中看到它们。
此外,没有可靠的方法来判断您看到的 cookie 中哪些是会话 cookie。有一个约定,使会话 cookie 具有大写名称,但您不能真正依赖它。
This is not possible - or at least, a generic solution is not possible. The reason is that many sites mark their session cookies as "httpOnly" meaning you can not see them from JavaScript.
Additionally, there is no reliable way to tell which ones among the cookies you do see are session cookies. There is a convention, sort of, to make session cookies have upper-case names, but you can't really rely on that.