WKWebview ajax添加cookie
2017-06-01 本文已影响502人
大热天晒太阳
wkwebview 用WKUserScript添加cookie,cookie的source里必须带上 path
NSString* cookieStr = [NSString stringWithFormat:@"%@=%@", name, value];
NSString* source = [NSString stringWithFormat:@"document.cookie = '%@;path=/';", cookieStr];