How set the same CookieStore for SWT browser and Jetty HttpClient

284 Views Asked by At

Since a java.net.CookieStore manages cookies in org.eclipse.jetty.client.HttpClient, I want to share the cookies with the SWT Browser widget.

HttpClient and Browser are both Eclipse technologies. Is there a way to have the same cookie store?

1

There are 1 best solutions below

2
Rüdiger Herrmann On BEST ANSWER

No, you cannot share the Cookie stores of HttpClient and SWT Browser. The Browser control uses the cookie store of the underlying native Browser, e.g. Mozilla, WebKit of IE.

You may want to try Browser::setCookie() and getCookie() to store and retrieve specific SWT cookies. The changes apply to all Browser control instances within an SWT application.