Tomcat throws IllegalArgumentException from CookieNameValidator
Issue
- We see the following exception for a request if the application sets a cookie name with special characters on the response:
java.lang.IllegalArgumentException: Cookie name [foobar==] is a reserved token
at javax.servlet.http.CookieNameValidator.validate(Cookie.java:464)
at javax.servlet.http.Cookie.<init>(Cookie.java:178)
Environment
- JBoss Web Server (JWS)
- 3.x
- Tomcat 8.0.x
- 5.x
- Tomcat 9.0.x
- 6.x
- Tomcat 10.1.x
- 3.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.