View Full Version : Reading Browser Cookies with JavaScript...

08-28-2007, 09:38 PM
I have a project that I am currently working on and it requires some javascript coding for it to function as I need it to. Or, at least I think it does.

Now, I am not talking about some kind of malicious coding, or spyware writing by any means, but I do need it to be able to read the cookies from a site other than my own. At least I think this is what is required. What I am trying to accomplish is this; I have a stats package setup on a different domain than my live website and I am using it to track the stats of the users on my site other than paying for stats service through some other company, and it seems to be working just as I need it to, only I would like for it to be able to do a little bit more. Right now, all it is capturing form the user is their IP address, browser information and host information on their ISP. But, I would like for it to be able do more. I would like for it to be able to retrieve certain cookies generated by a different site and show me the information in which the cookies hold... I am not talking about displaying passwords or any such thing like that, I just need certain information.

If you are interested in helping me out, please PM me.


08-28-2007, 09:42 PM
You cannot read cookies from different domains in javascript or any other language. It's a security measure built into all browsers.