//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]