mc73 Well-Known Member Licensed User Longtime User Sep 17, 2014 #1 In B4A we can user the cookie manager lib in order to get cookies from a page loaded in a webview. Is there something similar in b4j?
In B4A we can user the cookie manager lib in order to get cookies from a page loaded in a webview. Is there something similar in b4j?
Erel B4X founder Staff member Licensed User Longtime User Sep 18, 2014 #2 Try this code which is based on the solution posted here: http://stackoverflow.com/questions/23409138/clear-the-session-cache-cookie-in-the-javafx-webview Code: Copy Dim manager As JavaObject manager.InitializeNewInstance("java.net.CookieManager", null) Dim handler As JavaObject handler.InitializeStatic("java.net.CookieHandler").RunMethod("setDefault", Array(manager)) Use the debugger to see whether the cookies are available in manager. Upvote 0
Try this code which is based on the solution posted here: http://stackoverflow.com/questions/23409138/clear-the-session-cache-cookie-in-the-javafx-webview Code: Copy Dim manager As JavaObject manager.InitializeNewInstance("java.net.CookieManager", null) Dim handler As JavaObject handler.InitializeStatic("java.net.CookieHandler").RunMethod("setDefault", Array(manager)) Use the debugger to see whether the cookies are available in manager.
victormedranop Well-Known Member Licensed User Longtime User Sep 14, 2017 #3 Erel said: Try this code which is based on the solution posted here: http://stackoverflow.com/questions/23409138/clear-the-session-cache-cookie-in-the-javafx-webview Code: Copy Dim manager As JavaObject manager.InitializeNewInstance("java.net.CookieManager", null) Dim handler As JavaObject handler.InitializeStatic("java.net.CookieHandler").RunMethod("setDefault", Array(manager)) Use the debugger to see whether the cookies are available in manager. Click to expand... This code can be used in a non-ui application in B4J? Upvote 0
Erel said: Try this code which is based on the solution posted here: http://stackoverflow.com/questions/23409138/clear-the-session-cache-cookie-in-the-javafx-webview Code: Copy Dim manager As JavaObject manager.InitializeNewInstance("java.net.CookieManager", null) Dim handler As JavaObject handler.InitializeStatic("java.net.CookieHandler").RunMethod("setDefault", Array(manager)) Use the debugger to see whether the cookies are available in manager. Click to expand... This code can be used in a non-ui application in B4J?
Erel B4X founder Staff member Licensed User Longtime User Sep 15, 2017 #4 No. It will not affect OkHttp. Upvote 0