tomcat 8.5 设置cookies 异常错误

2019/09/24 by Jinyang | Filed under 技术相关.

java.lang.IllegalArgumentException: An invalid domain [.*****.com] was specified for this cookie
at org.apache.tomcat.util.http.Rfc6265CookieProcessor.validateDomain(Rfc6265CookieProcessor.java:210)
at org.apache.tomcat.util.http.Rfc6265CookieProcessor.generateHeader(Rfc6265CookieProcessor.java:145)
at org.apache.catalina.connector.Response.generateCookieString(Response.java:981)
at org.apache.catalina.connector.Response.addCookie(Response.java:929)
at org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.java:386)
at javax.servlet.http.HttpServletResponseWrapper.addCookie(HttpServletResponseWrapper.java:58)
at javax.servlet.http.HttpServletResponseWrapper.addCookie(HttpServletResponseWrapper.java:58)

修改 conf目录下的 content.xml ,添加以下语句
<!– 添加代码 –> <CookieProcessor className=”org.apache.tomcat.util.http.LegacyCookieProcessor”/>


Leave a Reply

Your email address will not be published. Required fields are marked *

返回顶部