After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679369 - Port cookies persistency to WebKit2
Port cookies persistency to WebKit2
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Backend
git master
Other Linux
: Normal normal
: ---
Assigned To: Xan Lopez
Epiphany Maintainers
Depends on:
Blocks: 678610
 
 
Reported: 2012-07-04 07:00 UTC by Carlos Garcia Campos
Modified: 2012-07-13 10:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (3.82 KB, patch)
2012-07-12 09:57 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2012-07-04 07:00:04 UTC
Persistent cookies are stored in a sqlite database, but WebKit2 doesn't have API to specify a location for the sqlite database yet. See WebKit bug:

https://bugs.webkit.org/show_bug.cgi?id=83016
Comment 1 Carlos Garcia Campos 2012-07-12 09:57:24 UTC
Created attachment 218611 [details] [review]
Patch
Comment 2 Xan Lopez 2012-07-13 09:00:40 UTC
Review of attachment 218611 [details] [review]:

::: lib/ephy-web-app-utils.c
@@ +266,3 @@
+  filename = g_build_filename (ephy_dot_dir (), "cookies.sqlite", NULL);
+  jar = (SoupCookieJar*)soup_cookie_jar_sqlite_new (filename, TRUE);
+  g_free (filename);

I see this as a less-than-ideal solution. I think we really need to add API to read the cookies in the current jar, having to create read-only jars each time we want to access them seems like a no-go. Can you perhaps add here a TODO or FIXME mentioning that?

Also, I'm not 100% sure that it's actually ok to do this, although I cannot think how it could fail given that the jar is read-only, we create it temporarily to read the cookies, and close it immediately after.
Comment 3 Carlos Garcia Campos 2012-07-13 09:59:24 UTC
(In reply to comment #2)
> Review of attachment 218611 [details] [review]:
> 
> ::: lib/ephy-web-app-utils.c
> @@ +266,3 @@
> +  filename = g_build_filename (ephy_dot_dir (), "cookies.sqlite", NULL);
> +  jar = (SoupCookieJar*)soup_cookie_jar_sqlite_new (filename, TRUE);
> +  g_free (filename);
> 
> I see this as a less-than-ideal solution. I think we really need to add API to
> read the cookies in the current jar, having to create read-only jars each time
> we want to access them seems like a no-go.

I agree, fortunately creating web apps is not something you have to do often.

> Can you perhaps add here a TODO or
> FIXME mentioning that?

Sure.

> Also, I'm not 100% sure that it's actually ok to do this, although I cannot
> think how it could fail given that the jar is read-only, we create it
> temporarily to read the cookies, and close it immediately after.

Yes, I don't think it's a problem.