For me when you close the browser the session is invalidated...

also, tomcat also has a 30min default expiry for inactive sessions
(elimating the need for below)

----- Original Message -----
From: "Rick Roberts" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Saturday, July 12, 2003 11:30 PM
Subject: Re: Servlet help needed!


> //Invalidate session if inactive for more than 1 hour
> if(!session.isNew()){ // skip new sessions
>    Date hourAgo = new Date(System.currentTimeMillis() - 60*60*1000);
>    Date accessed = new Date(session.getLastAccessedTime());
>
>    if(accessed.before(hourAgo)) session.invalidate();
> }
>
> FIkayo Otun wrote:
> > Good day(Sir/ma), I am a java programmer just starting to explore the
J2ee platform. I use jdk1.4.2... and tomcat to develop and deploy my
servlet. I however need a way to end my session when ever I close my
browser.  I noticed when I close my browser my session will still be on. I
am currently ussing servlet to develop an online apllication. I this I realy
need to find A solution to my problem.
> >
> > Fikayo, from Nigeria
>
> --
> *******************************************
> * Rick Roberts                            *
> * Advanced Information Technologies, Inc. *
> *******************************************
>
>
> ---------------------------------------------------------------------
> 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