W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2009

[whatwg] Accessing cookies from workers

From: Drew Wilson <atwilson@google.com>
Date: Thu, 5 Mar 2009 15:02:13 -0800
Message-ID: <f965ae410903051502t4942ba8dxdc45868390d94556@mail.gmail.com>
Hi all,

There's currently no way to set or get cookies from workers, which makes
various types of cookie-based operations problematic.

I'd like to suggest that we add an API to workers to support this, via a
"cookie" attribute on the WorkerGlobalScope interface. This cookie attribute
would act like the document.cookie attribute from page context.

When setting cookies, the cookie path would default to the path of the
script associated with the worker. Likewise, the cookie domain would default
to the domain of the worker itself (i.e. self.location.hostname).

So, as an example:

    var allCookies = self.cookie;

An alternative would be to have explicit getAllCookies() and setCookie()
APIs, if we don't like carrying over the document.cookie paradigm.

Any thoughts?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090305/b050ac88/attachment.htm>
Received on Thursday, 5 March 2009 15:02:13 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:10 UTC