According to Apple documentation on NSHTTPCookieStorage
The NSHTTPCookieStorage class provides the interface for managing the collection of NSHTTPCookie objects shared by all applications.
Therefore, If I'm not mistaken, since a Webview on OS X uses NSHTTPCookieStorage, and Safari uses Webviews, if I login on a given website on a Webview, Safari will use the cookies that has been set by the Webview and when the same website is opened by Safari, it should be authenticated.
My question is, if cookies are shared between Safari and Webviews. If so, why the test above is not working ?