I need to access all the cookies from a JavaFX WebView. As far as I can see there\'s a com.sun.webkit that implements its own CookieManager, Cookie, etc, etc. In that implem
There is no direct way in java as far as I know, but you can communicate with the javascript side of a webPage, meaning you could do something like this: (not tested!)
WebView wv; //assumed to be initialized
WebEngine we = wv.getEngine();
String cookie = (String)we.executeScript("return document.cookie"):
Yes this means you got the usual restrictions to coockie acces as you normally have in javascript. But it might be enough in your case.
EDIT:
Apparently its also possible using the java.net library (e.g.
java.net.CoockieHandler.getDefault()
). In this SO post you can find a bit more on how to use it, and here is the CoockieManager documentation.