On Fri, 23 Mar 2001, Neil Aggarwal wrote:
> Hello:
>
> I have tried tomcat 3.2.1 and 3.2.2 (4.0 bombed so I could not
> try it) and I am getting this problem:
>
> I am creating a member-based site. Each tiem a member
> logs in, I create a User object for them and store it
> as a session attribute.
>
> Each page (In its header) checks for the presence of
> of that session attribute before showing the page.
>
> For some reason, the member pages are coming up in a
> different session and the user is taken to a page
> that they are not logged it.
>
> Is there a bug with the session tracking in Tomcat?
>
The most likely explanation is that you are using instance variables in
your servlets, instead of local variables, to represent the information
for a particular request. These variables are shared across all of the
simultaneous requests to the same servlet, so it's easy for one request to
scribble on the data of another request.
> Thanks,
> Neil.
>
Craig McClanahan