Title: Reusing or replacing a session object??!!

I have a question/problem related to the session object, which I hope I can
get some help with.

The problem is as follows. A user accesses the application for the first time. The initial JSP
page uses a bean to create the top object in the application hierarchy. The top object calls
the getSession in the httpServletRequest class.

A number of objects are created, most of which have a reference to the top object.
When the user exits the application, a welcome back page is shown for a few seconds and then
the browser window is closed. At this time, the top object sets a shutdown timer, to allow messages
from the backend (intended for the customer) to drain out. Some 15 seconds later the session object
is invalidated.

The problem I have is when the customer starts up a new window and re-access the initial JSP page
again, before the shutdown timer has expired. In this case I would like the customer to start fresh all
over again.

I've tried to reuse the top object and create new objects in the application hierarchy. This gives
me two sets of application object. This would be ok, except for the that the old objects still have a reference to
the top object and still interacts with it. The application objects are being shutdown at various stages during
the application exit and shutdown timer.

What is a prefered way of dealing with this kind of scenario? Reuse the old objects, create a new top level
object and somehow create and replace the old session id, or....

Any help is appreciated.

/Peter

Reply via email to