0

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?

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).

Iswanto San
  • 18,263
  • 13
  • 58
  • 79
user1938653
  • 611
  • 1
  • 9
  • 21

3 Answers3

1

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.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
  • Thanks, is there a way to look for a specific cookie? and also to echo it on the browser's address bar itself? cuz' thats what I was trying to do... – user1938653 Apr 19 '13 at 01:06
  • What, exactly, are you trying to learn here? What you're attempting to do doesn't seem like it's going to teach you anything useful. – ceejayoz Apr 19 '13 at 01:25
  • I put a similar answer on user's other same question, before I saw this one: http://stackoverflow.com/questions/16135529/accessing-a-cookies-value-through-the-address-bar/16137024#16137024 – Kevin Hakanson Apr 21 '13 at 22:50
0

Most browsers can just show you the value of cookies for all sites you've visited (including the current one). So, it's probably just easier to examine the cookie values there. I know Firefox has a full built-in UI for displaying all the cookies for a given domain. I suspect Chrome does too, but I'll have to look for that now to see if I can find it.

In Chrome, you go to:

Settings
Show Advanced Settings
Privacy/Content Settings...
All Cookies and Site Data...
Click on a Domain
Click on a cookie name
See the value for that cookie name
jfriend00
  • 683,504
  • 96
  • 985
  • 979
0

Other than using the address bar you might want to look at the JavaScript console (CTRL+SHIFT+J for PC, I'm not sure about Apple). You can write JavaScript expressions there without having to use window.alert() etc.

Michael W
  • 690
  • 1
  • 9
  • 22