Bug 147288 - [GTK] Enable persistent cookie storage in MiniBrowser.
Summary: [GTK] Enable persistent cookie storage in MiniBrowser.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hyungwook Lee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-24 19:46 PDT by Hyungwook Lee
Modified: 2017-03-11 11:05 PST (History)
2 users (show)

See Also:


Attachments
Patch (1.33 KB, patch)
2015-07-24 19:58 PDT, Hyungwook Lee
no flags Details | Formatted Diff | Diff
Patch (1.29 KB, patch)
2016-01-11 21:45 PST, Hyungwook Lee
cgarcia: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hyungwook Lee 2015-07-24 19:46:01 PDT
I think it will be good if we support persistent cookie storage in MiniBrowser.
Comment 1 Hyungwook Lee 2015-07-24 19:58:42 PDT
Created attachment 257507 [details]
Patch
Comment 2 Michael Catanzaro 2016-01-06 20:49:11 PST
Comment on attachment 257507 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=257507&action=review

Hi Hyungwook, why do you want this? It seems useful to me that when MiniBrowser is restarted, there are no cookies that could be affecting the results of whatever it is I'm testing. Maybe it's not likely to often cause problems in practice, though, so I'm not opposed to this change.

> Tools/MiniBrowser/gtk/main.c:298
> +    // Enable persistent cookie storage.

Please remove this comment, it's a "what" comment and doesn't add any value. We prefer comments that explain "why."
Comment 3 Hyungwook Lee 2016-01-11 21:22:37 PST
I think persistent cookie function is default function of most browser support it.

To prevent confusion of using cookie, we'd better to meet another browser's behavior even if it is mini-browser.
Comment 4 Hyungwook Lee 2016-01-11 21:45:28 PST
Created attachment 268747 [details]
Patch
Comment 5 Carlos Garcia Campos 2016-01-12 08:43:57 PST
Comment on attachment 268747 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=268747&action=review

MiniBrowser is not a general purpose browser, it's for testing, so I'm not sure we want to save cookies. I agree it could be useful for testing cookies, though. So, maybe we could add a command line option to pass the cookies storage path, or the other way around, always save cookies and add a command line option to not use persistent cookies.

> Tools/MiniBrowser/gtk/main.c:299
> +    webkit_cookie_manager_set_persistent_storage(cookieManager, g_build_filename(g_get_user_data_dir(), "webkitgtk", "cookies.db", NULL), WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE);

This is leaking the value returned by g_build_filename(), it returns a new allocated string that should be freed. Also, I don't think we should use a generic webkitgtk dir, but someting more specific like MiniBrowser.