In our web service we set a cookie through JavaScript which we read again in Java (Servlet)
However we need to escape the value of the cookie because it may contain illegal characters such as ‘&’ which messes up the cookie.
Is there a transparent way to escape (JavaScript) and unescape again (Java) for this?
In java you got StringEscapeUtils from Commons Lang to escape/unescape.
In Javascript you escape through encodeURIComponent, but I think the Commons component I gave to you will satisfy your needs.