修改cookie中没有path的问题

addCookies时如果path没有指定,path默认为/
This commit is contained in:
zhangzi0291
2021-03-16 00:33:12 +08:00
committed by GitHub
parent aaf4bb8931
commit f33df38f64

View File

@@ -44,7 +44,7 @@ public class SaTokenCookieUtil {
*/ */
public static void addCookie(HttpServletResponse response, String name, String value, String path, String domain, int timeout) { public static void addCookie(HttpServletResponse response, String name, String value, String path, String domain, int timeout) {
Cookie cookie = new Cookie(name, value); Cookie cookie = new Cookie(name, value);
if(SaTokenInsideUtil.isEmpty(path) == false) { if(SaTokenInsideUtil.isEmpty(path) == true) {
path = "/"; path = "/";
} }
if(SaTokenInsideUtil.isEmpty(domain) == false) { if(SaTokenInsideUtil.isEmpty(domain) == false) {
@@ -95,4 +95,4 @@ public class SaTokenCookieUtil {
} }
} }
} }