Try using this code. it is also compatible with JServer4
[CODE lang="b4x" title="Add Jserver5 support"]Sub ClearCookies
If HttpUtils2Service.hc.IsInitialized = False Then
HttpUtils2Service.Service_Create
End If
Log(HttpUtils2Service.hc.IsInitialized)
Dim jo As JavaObject = HttpUtils2Service.hc
Dim client As JavaObject = jo.GetField("client")
Dim jme As JavaObject = Me
Dim handler As Object = jme.RunMethod("getCookieHandler", Array(client.RunMethod("cookieJar", Null)))
Dim CookieManager As JavaObject = handler
CookieManager.RunMethodJO("getCookieStore", Null).RunMethod("removeAll", Null)
End Sub
#if JAVA
import java.lang.reflect.*;
public static Object getCookieHandler(Object o) throws Exception {
try {
Field f =...