iOS Code Snippet HttpJob Clear Cookies

lucasheer

Active Member
Licensed User
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!
 

Erel

Administrator
Staff member
Licensed User
B4X:
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
 
Top