From 129ed25ca4ad5d16cfc80d779bf4188c4b750cec Mon Sep 17 00:00:00 2001 From: Redkale <8730487+redkale@users.noreply.github.com> Date: Fri, 29 Mar 2019 09:08:16 +0800 Subject: [PATCH] --- src/org/redkale/net/http/HttpResponse.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/redkale/net/http/HttpResponse.java b/src/org/redkale/net/http/HttpResponse.java index 410101c16..c8c91b026 100644 --- a/src/org/redkale/net/http/HttpResponse.java +++ b/src/org/redkale/net/http/HttpResponse.java @@ -941,7 +941,7 @@ public class HttpResponse extends Response { } if (request.newsessionid != null) { String domain = defaultCookie == null ? null : defaultCookie.getDomain(); - if (domain == null) { + if (domain == null || domain.isEmpty()) { domain = ""; } else { domain = "Domain=" + domain + "; "; @@ -949,9 +949,9 @@ public class HttpResponse extends Response { String path = defaultCookie == null ? null : defaultCookie.getPath(); if (path == null || path.isEmpty()) path = "/"; if (request.newsessionid.isEmpty()) { - buffer.put(("Set-Cookie: " + HttpRequest.SESSIONID_NAME + "=; " + domain + "Path=" + path + "; Max-Age=0; HttpOnly\r\n").getBytes()); + buffer.put(("Set-Cookie: " + HttpRequest.SESSIONID_NAME + "=; " + domain + "Path=/; Max-Age=0; HttpOnly\r\n").getBytes()); } else { - buffer.put(("Set-Cookie: " + HttpRequest.SESSIONID_NAME + "=" + request.newsessionid + "; " + domain + "Path=" + path + "; HttpOnly\r\n").getBytes()); + buffer.put(("Set-Cookie: " + HttpRequest.SESSIONID_NAME + "=" + request.newsessionid + "; " + domain + "Path=/; HttpOnly\r\n").getBytes()); } } if (this.cookies != null) {