I've changed the value of a cookie on the site by typing javascript:document.cookie="CName=cValue"
in the URL Bar.
What script can I write to retrieve the value of cookie "CName" using a similar script right from the URL bar
I've changed the value of a cookie on the site by typing javascript:document.cookie="CName=cValue"
in the URL Bar.
What script can I write to retrieve the value of cookie "CName" using a similar script right from the URL bar
Check it out.
javascript:function getCookie(name) {var value = '; ' + document.cookie;var parts = value.split('; ' + name + '=');if (parts.length == 2) return parts.pop().split(';').shift();}alert(getCookie('CName'));
For something quick and dirty, that you type each time to view a cookie:
document.cookie.match(/\b__hstc=[^;]+/)
where __hstc
is the name of the cookie you want.
you might also want to wrap unescape around it, and don't forget javascript:
url conventions.
It works well even in devtools as well, which for some reason still has no cookie interface.
this is not a production-ready cookie method, but it gets the job done quickly in 99% of cases.