[whatwg] Accessing cookies from workers
atwilson at google.com
Sun Mar 8 15:32:21 PDT 2009
> document.cookies can't change in the middle of an execution. I.e. a script
> a = document.cookie;
> b = document.cookie;
> alert(a === b);
> will always show 'true'.
Is that strictly true? Can you point me to the appropriate part of the spec,
because I couldn't find anything relevant other than what I previously
quoted, and that doesn't seem to make any guarantees for the stability of
document.cookies (perhaps the spec itself needs to be clarified to provide
those guarantees?). Guaranteeing that relationship seems to imply that we
ignore cookies set by network calls that happen in parallel with the current
What if I do something like this:
alert("now is the time to block our execution to allow HTTP requests to
Is a===b still guaranteed to be true (maybe so)? It's assuredly *not*
guaranteed to be true if you swap out that alert with a synchronous xhr.
Anyhow, I'm not averse to having an asynchronous API, but I'd still like to
enable workers to do this:
Forcing workers to do all of their cookie-laden network requests via a
double-callback (set cookie, wait for callback, invoke xhr, wait for
response) seems too cumbersome.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg