0

I'm writing a Greasemonkey script for a forum, where I am going to be loading a bunch of URLs for forum threads. However, I want to do this in such a way that on the server side, the forum doesn't see the logged-in user who's using my script as accessing the URLs, since doing so has effects I want to avoid, like changing which forum posts have been read by that user. In my reading of how XMLHttpRequests work in Javascript, it looks like there's no way in Javascript or jQuery to just make the requests and have the requests not provide the cookies that the browser has for the site.

I'm looking to make the script work in both Firefox and Chrome, so Cookie Monster is out. And since it's a Greasemonkey script, it needs to not be extremely slow.

Is there some way in Javascript to load same-domain URLs and prevent the browser from sending cookies to the server? Alternatively, am I thinking about this the wrong way and there's some other way to load these URLs so that the server doesn't treat it as the user loading them?

Community
  • 1
  • 1
Keen
  • 1,327
  • 1
  • 17
  • 25
  • I don't think there will be a way to solve this without using a webserver to do the requesting instead of ajax. – Kevin B Dec 13 '13 at 19:48
  • Unset cookie -> make requests -> reset cookie (will only work if the forum doesn't set the `httponly` flag, which they probably do) – Prinzhorn Dec 13 '13 at 19:51
  • @Prinzhorn Great, how do you unset the cookie? – Keen Dec 13 '13 at 21:07
  • 1
    There's this awful [`document.cookies`](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) API. – Prinzhorn Dec 14 '13 at 07:47

0 Answers0