WebViewCookieManager

public class WebViewCookieManager : NSObject

WKWebView管理Cookie

KKJSBridge

  • 同步首个请求的Cookie

    Declaration

    Swift

    public static func syncRequestCookie(_ request: NSMutableURLRequest)
  • 同步请求的httpOnly Cookie

    Declaration

    Swift

    public static func syncRequestHttpOnlyCookie(_ request: NSMutableURLRequest)
  • 同步ajax请求的Cookie

    Declaration

    Swift

    public static func ajaxCookieScripts() -> String
  • 同步重定向请求的Cookie

    Declaration

    Swift

    public static func fixRequest(_ request: URLRequest) -> URLRequest
  • 拷贝共享Cookie到webView,iOS11+有效

    Declaration

    Swift

    @MainActor
    public static func copySharedCookie(_ webView: WKWebView, completion: (@MainActor @Sendable () -> Void)? = nil)
  • 拷贝webView到共享Cookie,iOS11+有效

    Declaration

    Swift

    @MainActor
    public static func copyWebViewCookie(_ webView: WKWebView, completion: (@MainActor @Sendable () -> Void)? = nil)
  • Cookie日期格式化对象

    Declaration

    Swift

    public static let cookieDateFormatter: DateFormatter