[webkit-gtk] New API to add and retrieve (full) cookies via the CookieManager
Mario Sanchez Prada
mario at webkit.org
Fri Oct 6 09:39:39 PDT 2017
On 05/10/17 17:06, Michael Catanzaro wrote:
> On Thu, Oct 5, 2017 at 3:57 PM, Mario Sanchez Prada <mario at webkit.org> wrote:
>> More thoughts?
>
> The API proposal looks great.
Thanks Michael. I almost finished the patches but needed to fork a bit my
attention into a local task that hijacked my attention span, but I will be
back to this one next week.
In the meantime, just one comment on the _delete_cookie() API proposal:
After reading RFC6265, in section 4.1.2 ("Semantics (Non-Normative)"):
[...]
If the user agent receives a new cookie with the same cookie-name,
domain-value, and path-value as a cookie that it has already stored,
the existing cookie is evicted and replaced with the new cookie.
Notice that servers can delete cookies by sending the user agent a
new cookie with an Expires attribute with a value in the past
[...]
...it occurs to me that perhaps a better API to delete a cookie would be to
do something like this, instead of passing a SoupCookie as parameter:
void
webkit_cookie_manager_delete_cookie (WebKitCookieManager *manager,
const char* name,
const char* domain,
const char* path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
The reason is that it sounds as if (name, domain, path) acted as a primary
key, and being that the case there would be little value on passing a
SoupCookie, that would force us to give a value as well for no reason.
If nobody opposes, this would be the API I'd be actually adding instead
> I thinkĀ https://bugs.webkit.org/show_bug.cgi?id=175265 will need to be fixed
> first for this to work reliably, though. And we are having some difficulty
> making progress there.
I heard about this one, but at the same time I think this API could be added
in parallel to the development efforts for that ticket, no?
Thanks,
Mario
[1] https://tools.ietf.org/html/rfc6265
More information about the webkit-gtk
mailing list