Before I call session.invalidate(), how can I make sure the session
has not been invalidate already because it will throw an exception if
it has.
Thanks
JF
I haven't tested these possiblities but you can give it a go:
- use HttpSession.isNew()
- Get the session back from the request object again
session = request.getSession(false);
if(session != null)
{
session.invalidate();
}
- or
session = request.getSession(true);
if(!session.isNew())
{
session.invalidate();
}
--
Tony Morris
(BInfTech, Cert 3 I.T.)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
Sun Certified Programmer for the Java 2 Platform (1.4)
Sun Certified Developer for the Java 2 Platform