tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Possible bug in tomcat wrt setting cookies?
Date Thu, 09 Nov 2000 19:28:14 GMT
Yes, this is a real bug in 3.2b6 (and probably earlier).  I checked in a patch
for it earlier this week, which will be included in b7 and the eventual release.

What caused the problem was kind of interesting -- the session stuff was
abstracted out into a RequestInterceptor, which would add the session cookie if
necessary.  The error case showed up when the first flush of the buffer occurred
in the included servlet/page, rather than the outer page before the include.
The session interceptor would be fired, and it would try to add the cookie ...
but included servlets/pages are (correctly) forbidden from trying to add cookies
or headers, so it never really got added.

The current workaround is to force a response.flushBuffer() before processing
the include.  However, this is related to some other RequestDispatcher issues
(such as the fact that RD did not use to propogate exceptions to the caller, in
violation of the spec).  Larry just checked in some changes -- it's my turn to
put eyeballs to them.  Anyone else who wants to help is urged to check out the
"tomcat_32" branch from CVS and help us get this right.


kenneth topp wrote:

> I apologize, this is with tomcat 3.2b4 and 3.2b6
> Thanks,
> On Wed, 8 Nov 2000, kenneth topp wrote:
> >
> > I think this is a bug:
> >
> > A servlet includes a .jsp (via include() not forward() )
> >
> > The servlet always creates a session.
> >
> > the session cookie never get's set, because the SessionInterceptor doesn't
> > have the Response that was given the sessionId... or something.
> >
> > Does this sound right?  If I addCookie in the servlet, it will get sent
> > when the user goes through an include.
> >
> > TIA,
> >
> > Kenneth Topp
> >
> >
> >
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message