3

So I have seen other questions about this, but none have been able to solve my issue.

I am getting a

org.apache.jasper.JasperException: java.lang.IllegalArgumentException: An invalid character [59] was present in the Cookie value

error. I am using DeviceLookupClient.jar and it adds a cookie somewhere that tomcat is refusing.

So when I run this in weblogic after everything is successful I get this cookie (from network tab):

WurflCloud_Client   
value   "{\"capabilities\":{\"is_smart…383,\"id\":\"firefox_54_0\"}"
expires "2017-08-17T16:03:03.000Z"

Run the same code in tomcat and it fails before that cookie ever gets created. I believe [59] character is a semicolon and I don't see any in there. If something in that cookie is not allowed then is there a way to allow it, rather than manipulate the library I am using?

Mr Man
  • 1,498
  • 10
  • 33
  • 54
  • If you check out this question it also says commas aren't allowed. https://stackoverflow.com/questions/1969232/allowed-characters-in-cookies Could it be that it has a problem with the comma and is throwing a false error that you have a semicolon? – Michael Aug 16 '17 at 16:12
  • @Michael Thanks for the comment. That's interesting, I am going to try a few things and see if I can replicate the error using a comma in the cookie on another page – Mr Man Aug 16 '17 at 16:18
  • So no matter what I do it works on my LOCAL tomcat server and every instance of my weblogic server. – Mr Man Aug 16 '17 at 18:00
  • Maybe your remote server is configured slightly differently than your local server? In that case you'd have to do more research on that I'm not familiar with tomcat server setup – Michael Aug 18 '17 at 14:02

1 Answers1

1

It might be solved if you encode the given value like this:

URLEncoder.encode(""{\"capabilities\":{\"is_smart…383,\"id\":\"firefox_54_0\"}"","UTF-8");
  • Yeah, I think that would fix it, but unfortunately the cookie is added deep within the library (DeviceLookupClient.jar) I am using. I guess I could change it and rejar it, but we usually don't do that. – Mr Man Aug 18 '17 at 14:14