Hello, through a javascript injection im trying to find out if a cookie exists on my computer. Here's the code I inject: javascript: if (document.cookie.indexOf('_idp_session') != -1) alert('cookie is here'); else alert('cookie is not here'); Code (markup): and when visiting the options of my browser, I can locate the cookie, and i can see its there. Nevertheless my script keeps telling me its not there.. what am i doing wrong?
cookies can only be accessed per domain. basically, if the document domain matches that of the domain of the cookie, it will become available to your javascript as well. as far as i remember, you are editing a new html form to log you in automatically from localhost - this won't work with the remote cookies. what you really need is a droplet - a firefox bookmarklet or possibly a greasemonkey / jetpack javascript that can automate this for you. if it's for personal use, then greasemonkey for firefox is the way to go, you can modify the remote site and perform whatever you like on it, automate things, style it etc.