当前位置: 代码迷 >> 综合 >> ios uiwebview 清理cookie的方法
  详细解决方案

ios uiwebview 清理cookie的方法

热度:6   发布时间:2023-12-11 14:07:51.0

清理一个URL中的cookie

    NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage];NSArray* arr_cookies = [cookies cookiesForURL:url];for (NSHTTPCookie* cookie in arr_cookies) {[cookies deleteCookie:cookie];}

清理所有的cookies

NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];for (NSHTTPCookie *cookie in [cookieStorage cookies]) {[cookieStorage deleteCookie:cookie];}



  相关解决方案