KIO / KWebView and PrivateBrowsing (Cookies)

Alex Fiestas afiestas at
Mon Apr 23 18:12:19 BST 2012

KWebView can't do Private Browsing because of KIO integration, need advice on 
how to fix it but first let me explain the issue.

What I consider PrivateBrowsing:
Private Browsing should have an empty CookieJar that will keep cookies only as 
long as the private browsing is activated, after that cookies will be removed.

What is happening now?
While in PrivateBrowsing all * new * cokies are created with an expiration 
date of "right now" and stored in kcookiejar. This is done by calling 
AccessManager::setDisablecookieStorage(false) and stored in 

File: kdelibs/kio/kio/accessmanager.cpp

All existing cookies will still be available to KWebPage, so even though I'm 
in PrivateBrowser authentifications will remain as well as any other 
information stored in the cookies.

As a practical usecase, in akonadi-google we need an empty cookieJar so any 
previous authentification on GMail will be ignored  (for example I can be 
authentificated with X account on rekonq while configuring Y account on 

Where is the problem located?
As far as I understood the code there are two problems:

-kio_http uses KCookieJar directly, and it doesn't have a Cookie mode like the 
one we need. It has: none, manual, auto we will need another one (private?).

-kio_http won't use any new QNetworkCookieJar we set via 
AccessManager::setNetworkCookieJar. This is more difficult to fix since 
kio_http is out of process. Maybe we can use some kind of DBus magic?

What do you think? makes any sense what I said? I'm missing something?

Thanks !

More information about the kde-core-devel mailing list