Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

special character is rejected by tomcat cookie parser

When I am trying to send a cookie from my android code to server-side code , the cookie parser does not accept the '@' character in value field i.e. tomcat's cookie parser reject this character when parsing mime headers to cookie. I tried using other special characters instead of '@' and those are working. Can anyone help me?

Example-: One of the mime header field is "cookie = [[email protected]]" but the corresponding cookie to this field is "_user = vishalgoyal2612"

like image 258
Vishal Goyal Avatar asked Sep 15 '25 18:09

Vishal Goyal


1 Answers

I had to set org.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0 to true.

Here is the source - https://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html

like image 198
Vishal Goyal Avatar answered Sep 17 '25 09:09

Vishal Goyal