B4J Question Cookie manager?

mc73

Well-Known Member
Licensed User
Longtime User
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
Upvote 0

victormedranop

Well-Known Member
Licensed User
Longtime User
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

B4X:
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.

This code can be used in a non-ui application in B4J?
 
Upvote 0
Top