웹뷰이름.evaluateJavaScript(script 함수이름 string, completionHandler: { result , error in })
// script source : document.cookie
let storage = WKWebsiteDataStore.default().httpCookieStore
storage.getAllCookies { cookies in }
let cookie = HTTPCookie(properties: [
.domain: "example.com",
.path: "/",
.name: "cookie_name",
.value: "cookie_value"
])!
websiteDataStore.httpCookieStore.setCookie(cookie) {
print("Cookie added!")
}
let storage = WKWebsiteDataStore.default().httpCookieStore
storage.delete(cookie,completionHandler)