Sahasra
Sahasra

Reputation: 109

An invalid character[44] was present in the Cookie value

When using Tomcat 8 Getting Error : java.lang.IllegalArgumentException: An invalid character [44] was present in the Cookie value at org.apache.tomcat.util.http.Rfc6265CookieProcessor.validateCookieValue(Rfc6265CookieProcessor.java:182) at org.apache.tomcat.util.http.Rfc6265CookieProcessor.generateHeader(Rfc6265CookieProcessor.java:115) at org.apache.catalina.connector.Response.generateCookieString(Response.java:986) at org.apache.catalina.connector.Response.addCookie(Response.java:934) at org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.java:386)

Upvotes: 2

Views: 9394

Answers (2)

Yerko
Yerko

Reputation: 1

I also had the same error in my project with Tomcat 8 and 9. The easiest but less optimal solution was to change to Tomcat 7, but when this version of Tomcat is deprecated or updated on the server I will have to go find all the commas and replace them in the cookie setting.

Upvotes: 0

NiVeR
NiVeR

Reputation: 9786

The character 0x44 is comma character and it is not allowed in cookies:

This string is a sequence of characters excluding semi-colon, comma and white space.

The reference comes from here.

Upvotes: 7

Related Questions