From e498a194377d598fb55ef9265b492ffedbf44504 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Mon, 1 Apr 2024 13:10:58 +0900 Subject: [PATCH] no message --- .../java/cokr/xit/base/ResponseHeaderFilter.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/cokr/xit/base/ResponseHeaderFilter.java b/src/main/java/cokr/xit/base/ResponseHeaderFilter.java index 7c9a9940..b45e4f12 100644 --- a/src/main/java/cokr/xit/base/ResponseHeaderFilter.java +++ b/src/main/java/cokr/xit/base/ResponseHeaderFilter.java @@ -7,6 +7,7 @@ import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; @@ -28,6 +29,19 @@ public class ResponseHeaderFilter implements Filter { chain.doFilter(request, new HttpServletResponseWrapper((HttpServletResponse) response) { + @Override + public void addCookie(Cookie cookie) { + + if(cookie.getValue().equals("") && cookie.getMaxAge() == 0) { + cookie.setValue("null"); + } + + cookie.setHttpOnly(true); + + super.addCookie(cookie); + + } + @Override public void setContentType(String type) { if(type.equals("text/css")