[webkit-gtk] New cookies API

Carlos Garcia Campos cgarcia at igalia.com
Thu Feb 9 05:04:04 PST 2017


We have now everything working with the new private browsing sessions,
except the cookie manager. It always works with the default session, so
if you create an ephemeral web context, its cookie manager will not
provide information about the ephemeral context, but about the default
one. One posible solution would be to make the cookie manager session
aware and simply pass the session ID to the cookie manager. But that
doesn't work for ephemeral web views created in non-ephemeral
contexts. 

The cookie manager shouldn't be attached to a web context anymore, but
to a website data manager. The website data manager already provides a
way to get the sites with cookies, and delete them, but we didn't
expose it there because we already had the cookie manager. 

So, I think we can deprecate the cookie manager and make the website
data manager handle the cookies. Making it return hosts with cookies,
and delete/clear them would be a matter of adding a new enum flag. But
then we have the configuration (persistent storage path and type, and
the policy) and changed signal. In this case the configuration is
different to other website data manager configurations that are
immutable, all cookies config can be changed at any time. Of course the
persistent storage can't be set on an ephemeral session.

My first idea was to add everything to the website data manager, but we
might add more cookies API in the future, like the possibility to
retrieve not only the host with the cookies but also the cookies
themselves, or to add a particular cookie or a set of them. There's a
WIP patch in bug #140191 that adds that new API to mac. So, maybe it's
better to have a separate class associated to the website data manager.

On the other hand, it could be weird that the API to get the domains
with cookies, delete and clear cookies is in website data manager and
any additional api is in a different object. So, I don't know what to
do.

-- 
Carlos Garcia Campos
http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 224 bytes
Desc: This is a digitally signed message part
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20170209/36e095e3/attachment.sig>


More information about the webkit-gtk mailing list