項目原先部署在tomcat6下面被甲方掃出漏洞要求整改,移植到tomcat9后登錄莫名出現
An invalid domain was specified for this cookie
在網上找了很多資料也是讓修改成合法的域名說tomcat8.5開始解析cookie變了,但是無論怎么修改代碼中的域名均無效,后來找到了一篇老外寫的文章,按其中的方法很快解決。ps:老外就是牛x
Set tomcat to use LegacyCookieProcessor (because Rfc6265CookieProcessor complies with RFC6265 which does not allow domains beginning with non-alphanumeric characters):�0�2
1. Edit the Tomcat/conf/content.xml�0�2
2. Add the statement in betweeen the <context> and </context> tags:�0�2
<CookieProcessor className="org.apache.tomcat.util.http.LegacyCookieProcessor" />�0�2
3. Restart Tomcat.