Hi Dean,

The most simplest check that I could think of is this:
request.getSession().isNew(); if this returns true, then the session is
a new one and hence, the previous session has been timed out. However,
this solution will not work if the server uses a cookie-based session
and the client has disabled cookies.

Another way to overcome this problem would be to set a variable in
session, in the beginning of your registration process. At the beginning
of every page, you check the variable is populated. If not, you will
know that the previous session has not been carried over.

Hope this helps.

Cheers,
Sweta


-----Original Message-----
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: 19 April 2004 16:18
To: [EMAIL PROTECTED]
Subject: detecting session timeout


Any suggestions on how to detect
session timeouts? I am experimenting
with extending TilesRequestProcessor
(I'm using struts 1.1 and tiles). Here's
an example of the kind of thing I would
like to detect: I have a multipage registration
process. Suppose a user gets halfway through
and then goes away for some reason (lunch?).
They come back and their session has timed
out. This means that the data that was gathered
and placed in the session on previous forms is
gone. The validator framework then complains
about missing data from the previous pages. I
just want to put up a special page indicating that
they took too long to register. I need this same
basic session in a number of places, so I really
need a general solution. Any ideas?

Dean Hoover


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to