Re: [whatwg] HTML Cookie API

2010-03-08 Thread Ian Hickson
On Tue, 23 Feb 2010, Adam Barth wrote: The document.cookie API is kind of terrible. Web developers shouldn't have to parse a cookie-string or prepare a properly formated set-cookie-string. Here's a proposal for an HTML cookie API that isn't as terrible:

Re: [whatwg] HTML Cookie API

2010-02-26 Thread Diogo Resende
What about something like: document.pushCookies(function () { // cookies have been pushed to the js process var x = document.getCookie(x); // whatever... }); This seems similar to Adam's proposed

Re: [whatwg] HTML Cookie API

2010-02-26 Thread Darin Fisher
On Fri, Feb 26, 2010 at 10:56 AM, Diogo Resende drese...@thinkdigital.ptwrote: What about something like: document.pushCookies(function () { // cookies have been pushed to the js process var x = document.getCookie(x); //

Re: [whatwg] HTML Cookie API

2010-02-26 Thread Diogo Resende
No. pushCookies would be a way of pushing cookies to the current js and then you could call getCookie several times without defining a callback. It would be almost like: document.observe(cookieload, myAppLoad)

Re: [whatwg] HTML Cookie API

2010-02-26 Thread Darin Fisher
On Fri, Feb 26, 2010 at 12:04 PM, Diogo Resende drese...@thinkdigital.ptwrote: No. pushCookies would be a way of pushing cookies to the current js and then you could call getCookie several times without defining a callback. It would be almost

Re: [whatwg] HTML Cookie API

2010-02-26 Thread Jonas Sicking
On Fri, Feb 26, 2010 at 12:20 PM, Darin Fisher da...@chromium.org wrote: On Fri, Feb 26, 2010 at 12:04 PM, Diogo Resende drese...@thinkdigital.pt wrote:         No. pushCookies would be a way of pushing cookies to the         current js and         then you could call getCookie several

Re: [whatwg] HTML Cookie API

2010-02-25 Thread Diogo Resende
On Wed, 2010-02-24 at 11:21 -0800, Darin Fisher wrote: For reference, reading document.cookie has measurable performance cost in Chromium since the cookie jar lives in a process separate from the process running JavaScript. We could have minimized this cost by caching the cookies locally, but

Re: [whatwg] HTML Cookie API

2010-02-25 Thread Darin Fisher
On Thu, Feb 25, 2010 at 6:54 AM, Diogo Resende drese...@thinkdigital.ptwrote: On Wed, 2010-02-24 at 11:21 -0800, Darin Fisher wrote: For reference, reading document.cookie has measurable performance cost in Chromium since the cookie jar lives in a process separate from the process running

Re: [whatwg] HTML Cookie API

2010-02-25 Thread Adam Barth
On Tue, Feb 23, 2010 at 10:48 PM, James Robinson jam...@google.com wrote: On Tue, Feb 23, 2010 at 9:21 PM, Adam Barth w...@adambarth.com wrote: On Tue, Feb 23, 2010 at 9:15 PM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Anne van Kesteren
On Wed, 24 Feb 2010 05:56:31 +0100, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible. Web developers shouldn't have to parse a cookie-string or prepare a properly formated set-cookie-string. Here's a proposal for an HTML cookie API that isn't as terrible:

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Darin Fisher
An explicit deleteCookie method might also be nice. -Darin On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible. Web developers shouldn't have to parse a cookie-string or prepare a properly formated set-cookie-string. Here's a

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Adam Barth
On Tue, Feb 23, 2010 at 10:22 PM, Darin Fisher da...@chromium.org wrote: On Tue, Feb 23, 2010 at 9:21 PM, Adam Barth w...@adambarth.com wrote: On Tue, Feb 23, 2010 at 9:15 PM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Adam Barth
On Wed, Feb 24, 2010 at 12:12 AM, Anne van Kesteren ann...@opera.com wrote: On Wed, 24 Feb 2010 05:56:31 +0100, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible.  Web developers shouldn't have to parse a cookie-string or prepare a properly formated

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Adam Barth
Done. On Wed, Feb 24, 2010 at 12:29 AM, Darin Fisher da...@chromium.org wrote: An explicit deleteCookie method might also be nice. -Darin On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible.  Web developers shouldn't have to

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Nicholas Zakas
To: Darin Fisher Cc: whatwg Subject: Re: [whatwg] HTML Cookie API Done. On Wed, Feb 24, 2010 at 12:29 AM, Darin Fisher da...@chromium.org wrote: An explicit deleteCookie method might also be nice. -Darin On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Darin Fisher
: My beliefs do not require them to. -Original Message- From: whatwg-boun...@lists.whatwg.org [mailto: whatwg-boun...@lists.whatwg.org] On Behalf Of Adam Barth Sent: Wednesday, February 24, 2010 8:47 AM To: Darin Fisher Cc: whatwg Subject: Re: [whatwg] HTML Cookie API Done. On Wed

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Jeremy Orlow
On Wed, Feb 24, 2010 at 8:23 PM, Peter Kasting pkast...@google.com wrote: On Wed, Feb 24, 2010 at 11:11 AM, Nicholas Zakas nza...@yahoo-inc.comwrote: I'm also less-than-thrilled with this being asynchronous, as I think the use cases for cookies are vastly differently than those for databases

Re: [whatwg] HTML Cookie API

2010-02-24 Thread David Flanagan
Jeremy Orlow wrote: Also note that the spec currently has the notion of a storage mutex which should be taken whenever a script tries to access a cookie (or local storage) and is held until the script finishes. The network stack is also supposed to take this lock whenever getting or

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Jeremy Orlow
On Wed, Feb 24, 2010 at 9:07 PM, David Flanagan da...@davidflanagan.comwrote: Jeremy Orlow wrote: Also note that the spec currently has the notion of a storage mutex which should be taken whenever a script tries to access a cookie (or local storage) and is held until the script finishes.

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Nicholas Zakas
...@google.com] On Behalf Of Jeremy Orlow Sent: Wednesday, February 24, 2010 12:20 PM To: David Flanagan Cc: Peter Kasting; whatwg; Nicholas Zakas; Darin Fisher; Adam Barth Subject: Re: [whatwg] HTML Cookie API On Wed, Feb 24, 2010 at 9:07 PM, David Flanagan da...@davidflanagan.com wrote

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Adam Barth
On Wed, Feb 24, 2010 at 12:44 PM, Nicholas Zakas nza...@yahoo-inc.com wrote: I think there’s always going to be a disconnect between browser developers and web developers, since we’re both living in very different worlds. Like I said, I’m all for making cookie access more rational (as if one

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Adam Barth
On Wed, Feb 24, 2010 at 11:11 AM, Nicholas Zakas nza...@yahoo-inc.com wrote: I like the idea of creating an easier way to deal with cookies (which is why I wrote the YUI Cookie utility way back when). The thing that seems to be missing in your proposed API is what I consider to be the most

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Garrett Smith
On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible.  Web developers shouldn't have to parse a cookie-string or prepare a properly formated set-cookie-string.  Here's a proposal for an HTML cookie API that isn't as terrible:

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Adam Barth
On Wed, Feb 24, 2010 at 4:03 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible.  Web developers shouldn't have to parse a cookie-string or prepare a properly formated

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Garrett Smith
On Wed, Feb 24, 2010 at 4:17 PM, Adam Barth w...@adambarth.com wrote: On Wed, Feb 24, 2010 at 4:03 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible.  Web developers shouldn't have

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Peter Kasting
On Wed, Feb 24, 2010 at 4:30 PM, Garrett Smith dhtmlkitc...@gmail.comwrote: Where is the argument for making the API async? Please see the discussion earlier in this thread. Can you be more specific? I see: | I really think the API should be asynchronous, as to avoid the mess | that

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Adam Barth
On Wed, Feb 24, 2010 at 4:30 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: On Wed, Feb 24, 2010 at 4:17 PM, Adam Barth w...@adambarth.com wrote: On Wed, Feb 24, 2010 at 4:03 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: Instead of array like, I would like to rather have a NamedCookieMap,

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Nicholas Zakas
what you believe! Morpheus: My beliefs do not require them to. -Original Message- From: Adam Barth [mailto:w...@adambarth.com] Sent: Wednesday, February 24, 2010 1:07 PM To: Nicholas Zakas Cc: Darin Fisher; whatwg Subject: Re: [whatwg] HTML Cookie API On Wed, Feb 24, 2010 at 11:11 AM

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Adam Barth
On Wed, Feb 24, 2010 at 5:00 PM, Nicholas Zakas nza...@yahoo-inc.com wrote: Even though there can be multiple cookies with the same name on a single document, this most frequently occurs due to error rather than intention. I've never received a YUI bug report about this occurrence though I

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Darin Fisher
On Wed, Feb 24, 2010 at 6:08 PM, Adam Barth w...@adambarth.com wrote: On Wed, Feb 24, 2010 at 5:00 PM, Nicholas Zakas nza...@yahoo-inc.com wrote: Even though there can be multiple cookies with the same name on a single document, this most frequently occurs due to error rather than intention.

Re: [whatwg] HTML Cookie API

2010-02-24 Thread Adam Barth
On Wed, Feb 24, 2010 at 8:49 PM, Darin Fisher da...@chromium.org wrote: Some other random comments: 1- Perhaps deleteCookie should also take an optional error callback. Done. It's a bit strange, but deleteCookie can fail in third-party contexts. 2- Is it possible for setCookie to be used to

[whatwg] HTML Cookie API

2010-02-23 Thread Adam Barth
The document.cookie API is kind of terrible. Web developers shouldn't have to parse a cookie-string or prepare a properly formated set-cookie-string. Here's a proposal for an HTML cookie API that isn't as terrible: https://docs.google.com/Doc?docid=0AZpchfQ5mBrEZGQ0cDh3YzRfMTRmdHFma21kMghl=en

Re: [whatwg] HTML Cookie API

2010-02-23 Thread Jonas Sicking
On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible.  Web developers shouldn't have to parse a cookie-string or prepare a properly formated set-cookie-string.  Here's a proposal for an HTML cookie API that isn't as terrible:

Re: [whatwg] HTML Cookie API

2010-02-23 Thread Adam Barth
On Tue, Feb 23, 2010 at 9:15 PM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible.  Web developers shouldn't have to parse a cookie-string or prepare a properly formated set-cookie-string.  

Re: [whatwg] HTML Cookie API

2010-02-23 Thread James Robinson
On Tue, Feb 23, 2010 at 9:21 PM, Adam Barth w...@adambarth.com wrote: On Tue, Feb 23, 2010 at 9:15 PM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 23, 2010 at 8:56 PM, Adam Barth w...@adambarth.com wrote: The document.cookie API is kind of terrible. Web developers shouldn't have to