[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ProgSoc] Detecting JSP session timeouts



Jay,
Please excuse this email cause i'm at the end of a very long week, but
could you not use getSession(false) and check if the session is null then
create a new one if it is needed? I'm not sure who is managing the
creation of Sessions, but i use this technique to do a similar thing to
you.

Cheers,
Bryn


On Tue, 13 Nov 2001, Jay Banyer wrote:

> How can I use session.isNew() to tell the difference between a session
> that has been timed out and a session that is new?
> 
> I don't want to display "You were logged out due to inactivity" when the
> user first visits the login page.
> 
> ie. when the user first visits the page, session.isNew() returns true.
> Subsequent visits to the page return false for isNew().
> 
> When a session times out, session.isNew() returns true. I can't think of
> a way to tell the difference. I can't store something in the session to
> indicate that the user has been here already, since the session object
> is new!
> 
> Cheers,
> Jay.
> 
> Suresh Rajagopalan wrote:
> > 
> > Use session.isNew() to determine whether the session has timedout.
> > 
> > On Thu, 25 Oct 2001, Jay Banyer wrote:
> > 
> > > I am writing a web site that uses the JSP session variable (implemented
> > > with a cookie) to maintain a users authentication status.
> > >
> > > The session automatically times out after a period of time. This is a
> > > feature of JSP sessions. After the session has timed out, it no longer
> > > contains any data, and the user has to login again.
> > >
> > > My question is: how can I tell that the session has timed out? ie, what
> > > is the difference between a session that has never authenticated and one
> > > that was authenticated but timed out?
> > >
> > > Cheers,
> > > Jay.
> --
> Jay Banyer
> Computer Systems Operator
> James Cook University, Townsville
> (07) 4781 6395
> -
> You are subscribed to the progsoc mailing list. To unsubscribe, send a
> message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
> If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.
> 

-- 
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc

Bryn D Price
bdprice@nospam.it.uts.edu.au
redshift@nospam.progsoc.uts.edu.au
bryn@nospam.progsoc.uts.edu.au

-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.