From 0c03d201a8f965e78482f9654fbba9003cbb57cf Mon Sep 17 00:00:00 2001 From: Alexander Skoblikov Date: Tue, 6 Feb 2024 17:50:46 +0400 Subject: [PATCH] CB-4596 fix http cookies (#2363) --- .../src/io/cloudbeaver/utils/WebAppUtils.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebAppUtils.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebAppUtils.java index c650c034ae..4371267b7e 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebAppUtils.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebAppUtils.java @@ -183,10 +183,12 @@ public static void addResponseCookie(HttpServletRequest request, HttpServletResp if (sameSite != null) { if (!request.isSecure()) { - log.debug("Attempt to set Cookie `" + cookieName + "` with `SameSite=None` failed, it require a secure context/HTTPS"); + log.debug("Attempt to set Cookie `" + cookieName + "` with `SameSite=" + sameSite + "` failed, it " + + "require a secure context/HTTPS"); + } else { + sessionCookie.setSecure(true); + path = path.concat("; SameSite=" + sameSite); } - sessionCookie.setSecure(true); - path = path.concat("; SameSite=" + sameSite); } sessionCookie.setPath(path);