tomcat 8.5 设置cookies 异常错误

2019-09-24 | By Jinyang | Filed in: 技术相关.

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”/>


发表评论

电子邮件地址不会被公开。 必填项已用*标注