Background prompt:
Severity: Error Processing request
Java.lang.IllegalArgumentException:Control character in cookie value or attribute.
At Org.apache.tomcat.util.http.CookieSupport.isV0Separator (cookiesupport.java:165)
At Org.apache.tomcat.util.http.Cookies.processCookieHeader (cookies.java:349)
At Org.apache.tomcat.util.http.Cookies.processCookies (cookies.java:176)
At Org.apache.tomcat.util.http.Cookies.getCookieCount (cookies.java:106) ...
————————————————————————————————————————————————————\
Project brief: The exception that occurs when manipulating cookies in JS (still available in jquery)
The basic code is as follows: (modified)
if("Administrator" ==result.data.username) {//Administrator DesignDocument.cookie= "Username=" +escape (' System Administrator '); //$.cookie (' username ', ' system Administrator ');}Else{//General Staff DesignDocument.cookie= "Username=" +Escape (Result.data.username); Document.cookie= "Postid=" +result.data.postid;//Job IDDocument.cookie= "Induction_time=" +result.data.induction_time;//Time of entryDocument.cookie= "Monthlyleave=" +result.data.monthlyleave;//Holiday of the month} document.cookie= "Userid=" +result.data.id;//Document.cookie= "identification=" +result.data.identification;//Mark
Exception Analysis:
Problem with 1.cookie value
There is a problem with coding in 2.cookie, usually in Chinese.
Modify: In JS call Escape ("Chinese"), to encode,
When reading a cookie, use Unescape (Document.cookie) to decode
Add:
There are some problems encountered in server-side code, please go to the server to modify the code (server-side without escape).
Exception: Java.lang.IllegalArgumentException:Control character in cookie value or attribute.