tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: Tomcat and cookies caching issue
Date Thu, 26 Jul 2007 20:18:35 GMT
Hi Riccardo,

if I understood your description correct, your Tomcat server itself 
communicates with another backend to get the report. In this sentence it 
is important, that Tomcat and not the browser talks to this backend.

I expect that you do this via HTTP as well. Note that there is no HTTP 
client contained in Tomcat. Your webap must have an HTTP client bundled, 
which the app uses to talk to the other server. This client might well 
have some sort of cookie handling implemented, and it's the 
responsibility of the using webapp to correctly use and configure the 
HTTP client it bundled.

But I might have misunderstood you.

Regards,

Rainer

Riccardo wrote:
> On 7/26/07, Len Popp <len.popp@gmail.com> wrote:
>> I don't think Tomcat caches cookie values. I could be wrong about
>> this, but it seems to me that Tomcat just gets the cookie value from
>> the request sent by the browser.
> 
> I did a test to check this.
> After running a report I deleted the cookie from Firefox, tried to
> export and got the error message -> correct behaviour.
> But if I run the report, export to excel (and get the spreadsheet),
> rerun the report with different parameters, delete the cookie and
> click on export, I get the same spreadsheet as before. Looks like the
> request to the export asp file with the associated cookie gets cached
> for some reason.. and I don't believe is on Apache, because if I kill
> it and rerun it between the two export requests, the behaviour is the
> same.
> 
>> Maybe you should log the value of the cookie in various different
>> spots so you can follow the cookie's progress and see where it gets
>> mixed up. Places where you could log or view the cookie are:
>> - in your app where it creates and uses the cookie values
>> - in the access log for both Tomcat and Apache (the docs describe how
>> to log cookie values)
>> - in the browser, using a tool like LiveHTTPHeaders or ieHTTPHeaders
> 
> Yes, I'll try to check the content of the cookies in the different
> places.. i'll check out also the tools for the headers, that will be
> useful as well.
> 
> Thanks for your time
> Riccardo
> 
> 
> 
> 
> 
>> -- 
>> Len
>>
>> On 7/26/07, Riccardo <riccardo.andretta@gmail.com> wrote:
>> > Hi,
>> > I'm experiencing a problem with cookies cached - probably - in Tomcat
>> > for a couple of minutes.
>> > I'm running a webapp into Tomcat, which also connects to an apache
>> > proxy to embed an external page into the tomcat webapp. I need the
>> > apache proxy to get rid of the Javascript safety problems that occur
>> > when trying to interact with a page sourced from another domain name.
>> > The problem: I run in the externally source page a report, setting a
>> > few parameters. These parameters with my selected values are stored in
>> > a cookie called "Reports". After running the report I can click on a
>> > link to export it to excel. The asp script on the remote server will
>> > retrieve the params values from the cookie and generate the
>> > appropriate excel sheet. Now if after running a report I run another
>> > one, the cookie on my browser gets correctly updated, but if after
>> > that I try to export to excel this new report what I get from the
>> > remote server is the same excel sheet as before. I checked the Reports
>> > cookie on my browser and I see it's correctly updated after each
>> > report run, but i noticed that what is sent to the remote server is
>> > not the cookie stored in my browser, but a previous cookie, cached - i
>> > suppose - in Tomcat, because the generated excel sheet is the same as
>> > before, as the first report i've run. If i wait two minutes though and
>> > click again the excel export function, the correct sheet is built. So
>> > looks like Tomcat caches the Reports cookie for two minutes and this
>> > overrides the browser cookie.
>> > Another confirmation of this is that if I delete the Reports cookie
>> > from my browser after running a report, and click on export to excel,
>> > I still get the excel sheet, whereas after a couple of minutes the
>> > sheet can't be built anymore and some microsoft runtime error is
>> > generated.
>> >
>> > I was first thinking that it could be the apache proxy to cause this,
>> > so i tried to shut it down and up again after running a report and
>> > before trying to export it to see if it lost the cookie value in its
>> > cache, but this was not the case, so I ended up assuming the caching
>> > is happening inside Tomcat.
>> >
>> > I'm using Tomcat 5.0.28 and apache http server 2.2.4.
>> >
>> > Any suggestion will be much appreciated as i've alredy wasted a lot of
>> > time on this issue!!
>> >
>> > ---------------------------------------------------------------------
>> > To start a new topic, e-mail: users@tomcat.apache.org
>> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message