You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by thoudam <th...@ft.com> on 2010/05/18 13:02:35 UTC
Tomcat 6.0.18 unsupported character in cookie
I am using tomcat 6.0.18 and it wraps any cookie value containing invalid
characters like equals sign in double quotes. Our cookie contains lots of
equals sign and are legacy cookie used and also created by various other
applications. I do not want tomcat to wrap the cookie containing equals sign
in double quotes as we are not sure of the implication on other third party
applications using our cookie. We are not sure how these third party
application is reading our cookie and depending on the way they handle our
cookie they may not like double quoted cookie values. And we do not have any
control on these third party applications. Is there a way to stop tomcat
6.0.14 or later version from double quoting cookie values containing equals
sign?
--
View this message in context: http://old.nabble.com/Tomcat-6.0.18-unsupported-character-in-cookie-tp28594379p28594379.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6.0.18 unsupported character in cookie
Posted by André Warnier <aw...@ice-sa.com>.
THOIBA.THOUDAM@FT.COM wrote:
> Hi Mark,
> Thanks again. Your suggestion sounds like a way forward to solve our
> problem. I just tried it and it works. Our cookie containing non-spec
> complaint cookie values are being created without any double quotes.
> Could you please also let me know the difference between
> response.setHeader("Set-Cookie", "name=value") and
> response.addCookie(cookie)? Are there any disadvantage of using
> response.setHeader() to set cookies?
>
Have a look here :
http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/tomcat/util/http/ServerCookie.html
If you set a header via .setHeader(), you set a name and a value, as
strings. You can set whatever you want in this way, and there is no
checking of what you set. Which is exactly why you can set a
non-specs-compliant (in other words invalid) cookie in this way.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6.0.18 unsupported character in cookie
Posted by TH...@FT.COM.
Hi Mark,
Thanks again. Your suggestion sounds like a way forward to solve our
problem. I just tried it and it works. Our cookie containing non-spec
complaint cookie values are being created without any double quotes.
Could you please also let me know the difference between
response.setHeader("Set-Cookie", "name=value") and
response.addCookie(cookie)? Are there any disadvantage of using
response.setHeader() to set cookies?
Thanks,
Thoiba
Mark Thomas <ma...@apache.org>
18/05/2010 12:37
Please respond to
"Tomcat Users List" <us...@tomcat.apache.org>
To
Tomcat Users List <us...@tomcat.apache.org>
cc
Subject
Re: Tomcat 6.0.18 unsupported character in cookie
On 18/05/2010 12:24, THOIBA.THOUDAM@FT.COM wrote:
> Hi Mark,
> Thanks for your response. I believe you are referring to the change log
> description "Provide an option to allow the equals character in unquoted
> cookie values.". By upgrading to tomcat 6.0.26 and setting this system
> property, our application can read unquoted cookie values with equals
sign
> created by other application. However, when our tomcat creates the same
> cookie it double quotes the cookie value. I would like tomcat to stop
> double quoting our cookie value containing equals sign as other third
> party applications reading our cookie may not like it.
You'd have to add the cookie header manually in your application if you
want to write a non-spec compliant cookie. Tomcat always write spec
compliant cookies.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6.0.18 unsupported character in cookie
Posted by Mark Thomas <ma...@apache.org>.
On 18/05/2010 12:24, THOIBA.THOUDAM@FT.COM wrote:
> Hi Mark,
> Thanks for your response. I believe you are referring to the change log
> description "Provide an option to allow the equals character in unquoted
> cookie values.". By upgrading to tomcat 6.0.26 and setting this system
> property, our application can read unquoted cookie values with equals sign
> created by other application. However, when our tomcat creates the same
> cookie it double quotes the cookie value. I would like tomcat to stop
> double quoting our cookie value containing equals sign as other third
> party applications reading our cookie may not like it.
You'd have to add the cookie header manually in your application if you
want to write a non-spec compliant cookie. Tomcat always write spec
compliant cookies.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6.0.18 unsupported character in cookie
Posted by TH...@FT.COM.
Hi Mark,
Thanks for your response. I believe you are referring to the change log
description "Provide an option to allow the equals character in unquoted
cookie values.". By upgrading to tomcat 6.0.26 and setting this system
property, our application can read unquoted cookie values with equals sign
created by other application. However, when our tomcat creates the same
cookie it double quotes the cookie value. I would like tomcat to stop
double quoting our cookie value containing equals sign as other third
party applications reading our cookie may not like it.
Thanks once again
Thoudam
Mark Thomas <ma...@apache.org>
18/05/2010 12:14
Please respond to
"Tomcat Users List" <us...@tomcat.apache.org>
To
Tomcat Users List <us...@tomcat.apache.org>
cc
Subject
Re: Tomcat 6.0.18 unsupported character in cookie
On 18/05/2010 12:02, thoudam wrote:
>
> I am using tomcat 6.0.18 and it wraps any cookie value containing
invalid
> characters like equals sign in double quotes. Our cookie contains lots
of
> equals sign and are legacy cookie used and also created by various other
> applications. I do not want tomcat to wrap the cookie containing equals
sign
> in double quotes as we are not sure of the implication on other third
party
> applications using our cookie. We are not sure how these third party
> application is reading our cookie and depending on the way they handle
our
> cookie they may not like double quoted cookie values. And we do not have
any
> control on these third party applications. Is there a way to stop tomcat
> 6.0.14 or later version from double quoting cookie values containing
equals
> sign?
http://tomcat.apache.org/tomcat-6.0-doc/changelog.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6.0.18 unsupported character in cookie
Posted by Mark Thomas <ma...@apache.org>.
On 18/05/2010 12:02, thoudam wrote:
>
> I am using tomcat 6.0.18 and it wraps any cookie value containing invalid
> characters like equals sign in double quotes. Our cookie contains lots of
> equals sign and are legacy cookie used and also created by various other
> applications. I do not want tomcat to wrap the cookie containing equals sign
> in double quotes as we are not sure of the implication on other third party
> applications using our cookie. We are not sure how these third party
> application is reading our cookie and depending on the way they handle our
> cookie they may not like double quoted cookie values. And we do not have any
> control on these third party applications. Is there a way to stop tomcat
> 6.0.14 or later version from double quoting cookie values containing equals
> sign?
http://tomcat.apache.org/tomcat-6.0-doc/changelog.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org