在地址栏中执行javascript以获取&运行cookie的值 [英] Executing javascript in the Address Bar in order to get & run a cookie's value

查看:205
本文介绍了在地址栏中执行javascript以获取&运行cookie的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我从浏览网站(我不拥有)获得了Cookie,而且我知道Cookie的名称。
现在让我们说,我在那个网站,转到地址栏。我的问题是:我能够在输入某种Javascript代码后显示该cookie的值吗?或任何其他代码?

Let's say that I got a cookie just from browsing a website(which I do not own), and I know the cookie's name. Now let's say I am on that website, going over to the address bar. My question is: Would I be able to display the value of that cookie after entering some sort of Javascript Code? or Any other code?

这对我来说很重要,因为我正在学习网站。 (我知道我可以通过Cookie编辑器等获得Cookie值。我只是想通过地址栏获得它。)

It's kinda Important for me to learn right now as I am studying websites. (And I know that I can get the cookies value with "Cookie Editor" and etc. I am just trying to get it through the address bar too).

推荐答案

javascript:alert(document.cookie); 在Chrome的地址栏中工作正常(它会列出当前文档的所有Cookie) 。请注意,出于安全考虑,您必须键入,而不是粘贴 javascript:部分。

javascript:alert(document.cookie); in Chrome's address bar works fine for me (it'll list all cookies for the current document). Note that for security reasons you have to type, not paste, the javascript: part.

这篇关于在地址栏中执行javascript以获取&运行cookie的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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