Is there any other way to check expiry of session other than this
session.isNew()
Yes:
you can call HttpServletRequest.getSession(false) and you'll get a null instead of a session if there isn't one active already.
HttpServletRequest.getSession(false)
null
you can define a lifecycle listener (using HttpSessionListener) in your web.xml. That way you can get notified the moment a session bites the dust.
HttpSessionListener
web.xml
1.4m articles
1.4m replys
5 comments
57.0k users