GNOME Bugzilla – Bug 774011
Deleting all cookies leaves SQLite database on disk (including .sqlite-shm and .sqlite-wal files)
Last modified: 2017-01-15 14:57:55 UTC
We have the following code in WebKit in SoupCookieJar.cpp: void deleteAllCookies(const NetworkStorageSession& session) { SoupCookieJar* cookieJar = cookieJarForSession(session); GUniquePtr<GSList> cookies(soup_cookie_jar_all_cookies(cookieJar)); for (GSList* item = cookies.get(); item; item = g_slist_next(item)) { SoupCookie* cookie = static_cast<SoupCookie*>(item->data); soup_cookie_jar_delete_cookie(cookieJar, cookie); soup_cookie_free(cookie); } } It gets executed when cookies are cleared by Epiphany. Unfortunately it seems libsoup does nothing to remove the SQLite database cookies.sqlite, cookies.sqlite-shm, and cookies.sqlite-wal. We have a recent WebKit CVE for the .sqlite-shm and .sqlite-wal files not being deleted when clearing local storage; same issue applies here. Either libsoup should clean up all three files when the last cookie has been deleted, or it should grow API for doing so.
I think deleting all the db files only makes sense in the context of a "Clear Personal Data" sort of operation, and not necessarily every time the cookie jar happens to be empty. So I don't think this should happen automatically. There could be a "soup_cookie_jar_delete()" command, perhaps. (FWIW, a user might also imagine that they could manually delete only certain cookies, and have those cookies be obliterated from the disk. Perhaps we ought to be running sqlite with some option that makes it guarantee it will actually erase old data?)
(In reply to Dan Winship from comment #1) > (FWIW, a user might also imagine that they could manually delete only > certain cookies, and have those cookies be obliterated from the disk. > Perhaps we ought to be running sqlite with some option that makes it > guarantee it will actually erase old data?) Yeah, this is certainly what any reasonable user would expect. It's news to me that this wasn't already the case.
It looks like libsoup already does this, but only when the SoupCookieJar is freed.