特殊字符被tomcat cookie解析器拒绝 [英] special character is rejected by tomcat cookie parser

查看:240
本文介绍了特殊字符被tomcat cookie解析器拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试从我的android代码向服务器端代码发送cookie时,cookie解析器不接受value字段中的 @字符,即tomcat的cookie解析器在将mime标头解析为cookie时拒绝此字符。我尝试使用其他特殊字符代替 @,但这些字符仍有效。有人可以帮我吗?

When I am trying to send a cookie from my android code to server-side code , the cookie parser does not accept the '@' character in value field i.e. tomcat's cookie parser reject this character when parsing mime headers to cookie. I tried using other special characters instead of '@' and those are working. Can anyone help me?

示例-:MIME标题字段之一是
cookie = [_user=vishalgoyal2612@gmail.com]
,但与此字段对应的cookie是 _user = vishalgoyal2612

Example-: One of the mime header field is "cookie = [_user=vishalgoyal2612@gmail.com]" but the corresponding cookie to this field is "_user = vishalgoyal2612"

推荐答案

我必须设置org.apache.tomcat.util .http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0为true。

I had to set org.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0 to true.

以下是源- https://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html

这篇关于特殊字符被tomcat cookie解析器拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆