Ciao Diego!
While working with cookies, we had some issues handling not valid
characters.
One of our legacy (non java) server was used to put a blank (' ') character
as value of a cookie.
But it seems that blank it's a forbidden char so tomcat was not able to
parse the cookie value.
Is it possible that in the scenario you described there's a any other cookie
containing
some not valid characters that prevent tomcat to handle all cookies
correctly?
If you have any doubt on that, you may  try to access the cookie header
directly in order to see
which cookies the request contains.
HTH
Fil


On Thu, May 26, 2011 at 4:55 PM, Marcos Ortiz <mlor...@uci.cu> wrote:

> On 05/26/2011 04:28 AM, Diego Ruotolo wrote:
>
>> Hi,
>>
>> any suggestion for this problem?
>>
>> Thanks,
>>
>> best regards
>>
>> Il 25/05/2011 10.34, Diego Ruotolo ha scritto:
>>
>>> Hi,
>>>
>>> this is my first post to this list. Maybe it's a post more related to
>>> the developers list, if so please tell me so and I will send it to that
>>> list.
>>>
>>> Working with my company's webapp, I noticed a strange behaviour:
>>> sometimes http session, managed through JSESSIONID cookie, is lost. We
>>> use Tomcat 5.5.27 on Windows.
>>> Debugging Tomcat classes using the Eclipse debugger, I noticed that this
>>> happens because cookies are not correctly parsed, in fact:
>>>
>>> * Cookies (class org.apache.tomcat.util.http.Cookies) are instantiated
>>> when a new Request (class org.apache.coyote.Request) is created.
>>> * Constructor of class Cookies accept a MimeHeaders as argument.
>>> * Cookies are parsed using the method  getCookieCount(): this method
>>> sets the boolean variable "unprocessed" to false and call the method
>>> processCookies() for processing cookis from the header (that is the
>>> argument of the Cookies class constructor)
>>>
>>>
>>> Everything works fine, but sometimes it happens that even if cookies are
>>> correctly inserted in the request header (I can see it!) and
>>> "unprocessed" variable of class Cookies is set to false (== cookies
>>> parsed) , the cookies are NOT parsed: in fact the ServerCookie array is
>>> empty!
>>> It seems that is a time-related issue: IMHO the problem is that
>>> sometimes cookies are parsed BEFORE header is parsed.
>>>
>>> Hope I've been clear...
>>>
>>> Is this a known problem? Any suggestions? Maybe there is some
>>> "configuration tricks" I can use to avoid this problem?
>>>
>>> Thanks in advice,
>>>
>>> best regards
>>>
>>
>>  What say your Tomcat logs?
>
>
> --
> Marcos Luis Ortiz Valmaseda
>  Software Engineer (Distributed Systems)
>  http://uncubanitolinuxero.blogspot.com
>
>

Reply via email to