Is there a way to only see cookies that have been set on a specific host (rather than domain)? For example, the institution I work for uses an LMS system called WebCT. There are multiple WebCT servers inside the same domain that set the same cookie name. Is there a way in Javascript to distinguish between the cookies set on the two servers? A script that parsed out only the cookies that have been set on the same host the script is running would be perfect--right now I'm getting a semicolon delimited list of cookies that set the same cookie name. Thanks for your help, dex
Yep - unfortunately, this isn't enough to avoid conflicts with the two servers since they are both in the same domain. Actually... I think I figured out my problem. The cookie for the page you are currently on seems to always be listed later than previous cookies with the same name set on different servers. So... Never mind Thanks, Dex
Have the cookie name change for each host and only retrieve that cookie. If you haven't already found a workaround.
The cookie name cannot be changed because its set by webct... That's the problem. Basically, I was extracting the username of students who logged into their course by parsing a webct cookie, so that I can send it via AJAX to a remote server. Using the assumption that the current host's cookie will always be the last one listed in document.cookie, I was able to code around the issue... Hopefully this assumption is correct. So far, it seems to be working. Thanks. Matt