B4J Question remove cookies in jserver/Jetty

Erel

B4X founder
Staff member
Licensed User
Longtime User
Add this code after you start the server:
B4X:
Dim context As JavaObject = srvr
context = context.GetField("context")
Dim set As JavaObject
set.InitializeNewInstance("java.util.HashSet", Null)
Dim tracking As JavaObject
tracking = tracking.InitializeStatic("javax.servlet.SessionTrackingMode").GetField("URL")
set.RunMethod("add", Array(tracking))
context.RunMethodJO("getSessionHandler", Null).RunMethod("setSessionTrackingModes", Array(set))
 
Upvote 0

FrostCodes

Active Member
Licensed User
Longtime User
Add this code after you start the server:
B4X:
Dim context As JavaObject = srvr
context = context.GetField("context")
Dim set As JavaObject
set.InitializeNewInstance("java.util.HashSet", Null)
Dim tracking As JavaObject
tracking = tracking.InitializeStatic("javax.servlet.SessionTrackingMode").GetField("URL")
set.RunMethod("add", Array(tracking))
context.RunMethodJO("getSessionHandler", Null).RunMethod("setSessionTrackingModes", Array(set))

Thanks Erel ! I found out just now that it was my rest client that was creating this cookies for some reason i do not know.
but this helps :)
 
Upvote 0
Top