iOS 11 came with some changes and added some extra features to the WKWebView, basically each WKWebView now has its own cookie storage and its not share by the whole app and all other web views like in the case of (UIWebView).
Contrary to Apple's note that WKWebViews do NOT share cookie storage, and the many SO issues confirming that, recently I was testing multiple WKWebViews in separate ViewControllers and found that all my webviews were "sharing" cookies.
Take the basic example at https://developer.apple.com/documentation/webkit/wkwebview (ie:
self.webView = WKWebView(frame: self.mainView.bounds, configuration: webConfiguration) ) and create it across multipleViewControllerson the storyboard.In one Scene, set a cookie within the webpage you load say at localhost
Then open another scene and you will see that cookie exists in that WKWebView
I evaluated self.webView.configuration.websiteDataStore.httpCookieStore.getAllCookies for each ViewController and it reported the same cookies. self.webView being supposedly a new init WKWebView.
Question is, what is this "separate" cookie storage feature because it appears to be all sharing the same storage.
XCode 11.3.1 running a iPhone 11 Simulator on iOS 13.3