WKWebview ajax添加cookie

wkwebview 用WKUserScript添加cookie,cookie的source里必须带上 path

    NSString* cookieStr = [NSString stringWithFormat:@"%@=%@", name, value];
    NSString* source = [NSString stringWithFormat:@"document.cookie = '%@;path=/';", cookieStr];

你可能感兴趣的:(WKWebview ajax添加cookie)