Bug 67874 - Cookies are not available after turning off Private Browsing after the last window has been closed
Summary: Cookies are not available after turning off Private Browsing after the last w...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jessie Berlin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-09-09 16:31 PDT by Jessie Berlin
Modified: 2011-09-09 17:58 PDT (History)
6 users (show)

See Also:


Attachments
Patch (5.03 KB, patch)
2011-09-09 16:47 PDT, Jessie Berlin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jessie Berlin 2011-09-09 16:31:17 PDT
Private Browsing is a global setting, but it is treated as a per-page setting (see https://bugs.webkit.org/show_bug.cgi?id=67870).

When Private Browsing is turned on, a (global) Private Browsing Storage Session is created as a result of the call to Settings::setPrivateBrowsingEnabled(true);

When the last Page goes away, the last Settings object goes away.

When a new Page is created, a new Settings object is created and it's m_privateBrowsingEnabled value is initialized to false in the constructor.

When the PageGroup preferences are then applied to that Settings object to set the value to false, the early return if (m_privateBrowsingEnabled == privateBrowsingEnabled) in Settings::privateBrowsingStorageSession prevents the Private Browsing Storage Session from being destroyed.

Hence, when any request asks for the current storage session, it gets the Private Browsing storage session - where there are no cookies available from the normal browsing session.

<rdar://problem/9998144>
Comment 1 Jessie Berlin 2011-09-09 16:47:30 PDT
Created attachment 106940 [details]
Patch
Comment 2 Jessie Berlin 2011-09-09 17:13:22 PDT
The references to the PageGroup updating the settings after the Page is created in the comments are wrong. It should be the WebPage, not the PageGroup. I will fix the comments.
Comment 3 Ada Chan 2011-09-09 17:28:20 PDT
Comment on attachment 106940 [details]
Patch

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

> Source/WebCore/ChangeLog:20
> +           global value for the storage session from being destroyed.

Is "from being reset" better?
Comment 4 Ada Chan 2011-09-09 17:36:57 PDT
(In reply to comment #3)
> (From update of attachment 106940 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=106940&action=review
> 
> > Source/WebCore/ChangeLog:20
> > +           global value for the storage session from being destroyed.
> 
> Is "from being reset" better?

Actually what you have is fine.  Nevermind.
Comment 5 Jessie Berlin 2011-09-09 17:57:59 PDT
Comment on attachment 106940 [details]
Patch

Thanks for the review! Committed in http://trac.webkit.org/changeset/94892.