Bug 67874

Summary: Cookies are not available after turning off Private Browsing after the last window has been closed
Product: WebKit Reporter: Jessie Berlin <jberlin>
Component: WebCore Misc.Assignee: Jessie Berlin <jberlin>
Status: RESOLVED FIXED    
Severity: Normal CC: adachan, andersca, ap, jberlin, mitz, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Jessie Berlin
Reported 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>
Attachments
Patch (5.03 KB, patch)
2011-09-09 16:47 PDT, Jessie Berlin
no flags
Jessie Berlin
Comment 1 2011-09-09 16:47:30 PDT
Jessie Berlin
Comment 2 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.
Ada Chan
Comment 3 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?
Ada Chan
Comment 4 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.
Jessie Berlin
Comment 5 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.
Note You need to log in before you can comment on or make changes to this bug.