KIO / KWebView and PrivateBrowsing (Cookies)

Dawit A adawit at kde.org
Wed Apr 25 15:23:27 BST 2012


On Tue, Apr 24, 2012 at 8:13 AM, Alex Fiestas <afiestas at kde.org> wrote:

> After reading the patch and understanding a little bit more how this work I
> reached the following conclusion (potentially wrong as before :p).
>
> storageDisabled should work as it does right now (without the patch), it
> does
> disable any storage and allow reading, which imho it is exactly what you
> expect from "disable storage".
>
> So, how do we enable Private Browsing in AcessManager?
> By setting a different CookieJar, the default Qt implementation will do the
> job perfectly storing all the cookies in memory until the jar is destroyed
> (Private Browsing disabled).
>
> Right now any new CookieJar set via QNetworkAccessManager::setCookieJar
> will
> be ignored by Integration::AccessManager since at the end kio_http will use
> the "auto" cookie mode.
>
> So, the solution should be:
>
> -Fix the support for external QNetworkCookieJar's, this will have to be
> done
> anyway since Integration should have support for it.
>
> -Fix KWebPage to set a custom CookieJar when private browsing is activated.
>
> What do you think? does it make any sense at all this time?
>

Well actually it is a little bit simpler than that to get to what you want.
Keeping only the portion of my patch that deals with disabling cookie
handling in kio_http along with you setting your own custom cookiejar
through QWebPage::networkAccessManager()->setCookieJar should be sufficient
for what you are trying to do.

However, to properly fix the issue of "private browsing mode" for more
complex scenarios like allowing two separate instances of web browsers to
share cookies as it is done in other browser implementations (I checked
Chromium) requires a little bit more involved fix. We would need to use the
cookiejar and that means we need a way to mark such cookies as private to
the cookiejar. The trick is to do that without having to modify any of the
KDE cookiejar code. I will see what I can do about that...

Regards,
Dawit A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20120425/12a114a2/attachment.htm>


More information about the kde-core-devel mailing list