我想在多 wkwebview 上共享 cookie.但它不能很好.目标-c [英] i want cookie share on multi wkwebview. but it can't well. objective-c
问题描述
我的应用正在使用 UIWebview,但 UIWebview 有很多问题.
My app is using UIWebview but the UIWebview have a lot of problem.
所以我正在从 UIWebview 传输到 WKWebview.
So i'm transporting from UIWebview to WKWebview.
我的问题是 cookie.
My issue is cookie.
我的应用正在使用多个 WKWebview.
My app is using multiple WKWebview.
在WKWebviews中没有共享cookie,创建cookie很奇怪.
Cookie is did not share in WKWebviews and cookie create is very strange.
谁知道这件事?
推荐答案
尝试使用共享的 WKWebViewConfiguration.websiteDataStore.httpCookieStore
来设置 cookie,并在创建时将配置传递给 WKWebView-s.请参阅此处的代码:https://stackoverflow.com/a/49534854/1009546
Try using a shared WKWebViewConfiguration.websiteDataStore.httpCookieStore
to set cookies and pass the configuration to the WKWebView-s on creation. See the code here: https://stackoverflow.com/a/49534854/1009546
这篇关于我想在多 wkwebview 上共享 cookie.但它不能很好.目标-c的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!