My colleague and I are developing an annotation tool for web resources. One way The user can us the tool is to click a special bookmarklet to view the current page with annotations added. The bookmarklet works by sending the current page URL and the cookies for the page to a "page repeater" server, which fetches the real page (using the cookies) and modifies it to inject the javascript infrastructure for displaying annotations.
Today, we discovered that the page repeater doesn't work properly for StackOverflow pages. It seems that when the bookmarklet calls "document.cookie" to get the cookies for an SO page, it doesn't get all of the SO cookies. In particular, the "usr" cookie is missing. The net result is that the user appears to be not logged in.
There is nothing special about the "usr" cookie as far as we can tell. It is present in the browser's cookie store. It has the right domain and path, it is not marked as "secure", it has not expired, it doesn't have an overly long value. It just doesn't show up in the Javascript document.cookie
property with the rest of them.
We've reproduced this on both Firefox 3.6. and the latest Chrome.
Can anyone explain what is going on?