Many people often make this mistake when learning cookies. Someone asked me this question today, so I will share with you the solution to this problem (there is no specific solution on the Internet).
error code:
Cookie cookie=new Cookie("name","value value2");
response.addCookie(cookie);
Error
Java. Lang. IllegalArgumentException: An invalid character [32] was present in the Cookie value
Error code:
Cookie c=new Cookie("name","value,value2");
response.addCookie(c);
Error:
Java. Lang. IllegalArgumentException: An invalid character [44] was present in the Cookie value
…
the exception can be seen that this problem belongs to the invalid parameters, looking at the back of the prompt content
the An invalid character [44] was present in the Cookie value
cookies are invalid characters in character [44], so we query ASCII code is 44 said
“, “said 32 Spaces so we only need to replace the value of the corresponding characters, or coding
Read More:
- Illegalargumentexception: control character in cookie value or attribute tomcat7
- Three ways of adding cookie by scratch
- JMeter running error response code: non HTTP response code: java.lang.illegalargumentexception find and solve
- Parsing the exception of storing JSON string in cookie
- JS Ajax request is successful, the response displays “failed to load response data”
- Solutions to cookie output failure
- Some uncommon problems and solutions of cookie
- The video cannot be played because you have disabled the cookie
- java.lang.IllegalArgumentException: Address 127.0.0.1:5672:5672 seems to contain an unquoted IPv6
- Failed to set session cookie. Maybe you are using HTTP instead of HTTPS to access phpMyAdmin.
- java.lang.IllegalArgumentException : urlcoder exception resolution
- Chrome Broswer V98 Can not manually add cookies locally, refresh cannot be retained, and the cookie item is red
- What are the web front end technologies? What are the differences between cookie and session
- docker Error response from daemon: Bad response from Docker engine
- Error in adding jshint plug-in to vscode
- Solve the problem of illegalargumentexception: at least one JPA metadata must be present
- About WLW (Windows Live Writer): “unable to connect to your log service: invalid server response” solution
- java.lang.IllegalArgumentException: column ‘_id’ does not exist
- Adding fastjson dependency to Maven project
- Error 0 when adding SSL access to laravel project