iOS Code Snippet HttpJob Clear Cookies

Hello!

Is there a way to clear cookies from iHttpUtils2?

I found ways for B4A using JavaObject or Reflector and a custom HttpUtils2Service.

Is there a way with NativeObject possibly?

Thank you!
 
Code: Copy
Sub ClearCookies
Dim CookiesStorage As NativeObject
CookiesStorage = CookiesStorage.Initialize("NSHTTPCookieStorage").RunMethod("sharedHTTPCookieStorage", Null)
Dim Cookies As List = CookiesStorage.GetField("cookies")
For Each cookie As Object In Cookies
    CookiesStorage.RunMethod("deleteCookie:", Array(cookie))
Next
End Sub
 
Back
Top