A much better solution, usually, is to build your application so that it doesn't care if the same user logs on twice. Hi, I need to write a logout() method in my Java Bean to invalidate the current session upon logout.
You should offer the choice of closing their old session and starting a new one.
This is destroyed at the time of logout(when the user presses the logoff button). I've come across this before in a webapp I was writing and there is no satisfactory answer.
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums I initially thought "no, since the browser doesn't notify the server-side, there is no way to invalidate the session on browser close." But this didn't make sense when I thought of it. [ February 10, 2003: Message edited by: Mike Curwen ] I've got another opinion: It's not possible.
So you might investigate if using -1 gives you the behaviour you want.
But i keep getting error when i try to access the session.