Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.0.1
-
None
-
Trivial
-
N/A
-
N/A
-
Awaiting Committer feedback
-
Description
Hello,
I use XWiki.cookies.create / XWiki.cookies.read to create/read cookie but if I save a cookie with é by exemple, I obtain a blank page and this error:
juil. 20, 2015 3:30:14 PM org.apache.coyote.ajp.AjpProcessor process GRAVE: Error processing request java.lang.IllegalArgumentException: Control character in cookie value or attribute. at org.apache.tomcat.util.http.CookieSupport.isHttpSeparator(CookieSupport.java:193)
Here some code to test in a XWiki.JavaScriptExtension object:
var Mycookie= 'Valué'; XWiki.cookies.create('Cookie',Mycookie,2); test = XWiki.cookies.read('Cookie'); alert(test);
and the bug: http://grokbase.com/t/tomcat/users/14226p4278/cookie-issue-with-tomcat-7-does-not-accept-the-character-%C3%A9
I know it is more a javascript + tomcat problem but it will be nice to improve
XWiki.cookies.create/read functions with an $escapetool.xml'like function:
encodeURIComponent(cookieValue)
It will be appreciate specially when we save current page name (with accentuated characters) in a cookie.
(Do you want I PR for https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/xwiki.js ?)
Thxs
Pascal B