Am always getting old session value. I tried with clearing cookies and restarted tomcat. Some times am getting new session Id and session creation time. Please assist me
isNew returns true the first time the server sees the user, and you are assuming that te first time the server sees the user, your code is being run.
I am not sure about the specifics of your application, but this obviously isn't true.
Rather than getting bogged down in the behaviour of a single method, have you tried reading a session value and then writing it if the value does not yet exist?
Meet Gaurav wrote:session.isNew() is always returning false
open the jsp page in your browser and check the cookies . if a cookie JSESSIONID id there for your host then the problem is in your jsp not in the servlet.