首页 > 解决方案 > 如何在 ios10 中从 WKWebView 获取/存储 cookie?

问题描述

我无法在 ios 10 中从 WKWebView 获取/存储 cookie。您能帮我解决这个问题吗?

标签: iosobjective-cswiftwkwebviewios10

解决方案


you can try theses suggestions given in answer. It works for me, i hope it will helpful for you :)

Getting all cookies from WKWebView

also you can try thin in your case [updated]

WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in records.forEach { record in print(record) }

推荐阅读