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>
Created attachment 106940 [details] Patch
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 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?
(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 on attachment 106940 [details] Patch Thanks for the review! Committed in http://trac.webkit.org/changeset/94892.