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")