diff --git a/src/main/java/qupath/lib/images/servers/omero/OmeroWebClient.java b/src/main/java/qupath/lib/images/servers/omero/OmeroWebClient.java index 6e2d1ec6..cce735b7 100644 --- a/src/main/java/qupath/lib/images/servers/omero/OmeroWebClient.java +++ b/src/main/java/qupath/lib/images/servers/omero/OmeroWebClient.java @@ -176,10 +176,8 @@ public void run() { String authenticate(final PasswordAuthentication authentication, final int serverID) throws Exception { var handler = CookieHandler.getDefault(); - if (handler == null) { - handler = new CookieManager(null, CookiePolicy.ACCEPT_ALL); - CookieHandler.setDefault(handler); - } + handler = new CookieManager(null, CookiePolicy.ACCEPT_ALL); + CookieHandler.setDefault(handler); if (this.token == null) this.token = getCSRFToken();