Bug 195065 - [Curl] Change default cookie db path to use in-memory database.
Summary: [Curl] Change default cookie db path to use in-memory database.
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-26 13:14 PST by Basuke Suzuki
Modified: 2019-02-27 15:10 PST (History)
9 users (show)

See Also:


Attachments
PATCH (4.22 KB, patch)
2019-02-26 13:25 PST, Basuke Suzuki
Basuke.Suzuki: review?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Basuke Suzuki 2019-02-26 13:14:09 PST
Currently a fixed location is defined. In real life use case, the path for cookie database must be set by application because cookie database is not protected by any sort of lock. Using in-memory database for default status is much better than silently conflicting.
Comment 1 Basuke Suzuki 2019-02-26 13:16:16 PST
Also setting a path via environment variable causes another hidden conflict. It should be removed.
Comment 2 Basuke Suzuki 2019-02-26 13:25:06 PST
Created attachment 363011 [details]
PATCH

Replace default path generation method with constant.
Comment 3 Alex Christensen 2019-02-26 13:49:11 PST
Comment on attachment 363011 [details]
PATCH

How will you be able to have persistent cookies?
Comment 5 Basuke Suzuki 2019-02-27 11:40:17 PST
All green. Ready to land. Review please.
Comment 6 Alex Christensen 2019-02-27 14:59:39 PST
I think this is doing the wrong thing.  If you want to make tests not flakey, you should probably hook up NetworkProcess::switchToNewTestingSession.  If you want to make different applications not corrupt their cookies, make the default path dependent on the application.  If you want to make the same application not corrupt its cookies, have it use the same WebProcessPool-wrapping objects for its WebPageProxy-wrapping objects to make it so there is only one process opening the file at the same time.
Comment 7 Basuke Suzuki 2019-02-27 15:10:27 PST
(In reply to Alex Christensen from comment #6)
> I think this is doing the wrong thing.  If you want to make tests not
> flakey, you should probably hook up
> NetworkProcess::switchToNewTestingSession.

Solving a flakiness is an added bonus of the main concern below.


> If you want to make different
> applications not corrupt their cookies, make the default path dependent on
> the application.

This is the main concern about this patch. Library doesn't have any information about application. It has to be set explicitly. If the cookie path is prepared from peace of information about application, what the different from passing cookie database provided from application?

Maybe we should disable cookie feature until cookie database is explicitly supplied. What do you think?


> If you want to make the same application not corrupt its
> cookies, have it use the same WebProcessPool-wrapping objects for its
> WebPageProxy-wrapping objects to make it so there is only one process
> opening the file at the same time.

This is not the case for us.