FWIW, I wrote my tests using IE7, not IE8.<div><br></div><div>The original argument I was countering was "browsers currently enforce synchronous access to cookies, so we can't add asynchronous access via workers because that will break existing sites". Clearly, this argument was incorrect, since the core assumption about current browser behavior was wrong - in point of fact, the majority of browsers in use today make no such guarantees. So giving workers access to document.cookies is compatible both with the current language in the spec *and* the current behavior of the majority of browser implementations.</div>
<div><br></div><div>That said, if we don't think this behavior is acceptable (and there are good arguments against it), then we should change the spec for cookies to disallow it.</div><div><div><br></div><div>-atw<br>
<br><div class="gmail_quote">On Sat, Mar 21, 2009 at 2:13 PM, Jonas Sicking <span dir="ltr"><jonas@sicking.cc></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, Mar 20, 2009 at 3:29 PM, Ian Hickson <ian@hixie.ch> wrote:<br>
</div><div class="im">> On Sat, 7 Mar 2009, Jonas Sicking wrote:<br>
>><br>
>> document.cookies can't change in the middle of an execution. I.e. a<br>
>> script like:<br>
>><br>
>> a = document.cookie;<br>
>> b = document.cookie;<br>
>> alert(a === b);<br>
>><br>
>> will always show 'true'.<br>
><br>
> On Mon, 9 Mar 2009, Drew Wilson wrote:<br>
>><br>
>> Following up on this. I created two pages, one that tests cookies in a<br>
>> loop, and one that sets cookies in a loop, and ran them in separate<br>
>> windows in Firefox 3, IE7, and Chrome.<br>
>><br>
>> Chrome and IE7 currently allow concurrent modification of<br>
>> document.cookies (i.e. the test loop throws up an alert). Firefox does<br>
>> not.<br>
><br>
> I do not think there is a problem with providing self.cookie in workers,<br>
> exposing the cookie of the script. However, currently there doesn't seem<br>
> to be much support for this.<br>
><br>
> What do other browser vendors think of this?<br>
><br>
> Jonas, given the above information regarding IE's behaviour, do you still<br>
> think that providing such an API in workers is a problem?<br>
<br>
</div>It's the vendors that have exposed their users to this inconsistency<br>
that you should ask. Or maybe sites that use document.cookie a lot and<br>
that have a lot of chrome or IE8 users. Though both of those browsers<br>
might be too new to have received a lot of feedback regarding this.<br>
Note that this is only really a problem on sites that modifies<br>
document.cookie a lot, and where users have multiple tabs open to the<br>
same site.<br>
<br>
Personally I don't see how this couldn't be a problem. The only thing<br>
that'd save us is that cookies are generally not heavily used. But I<br>
bet there are sites out there that do use document.cookie a lot.<br>
<font color="#888888"><br>
/ Jonas<br>
</font></blockquote></div><br></div></div>