Invalidating session in jsp
Let us create a Servlet Listener that just counts the number of running http sessions and prints the details whenever a session gets created or destroy.
Starts eclipse and create a new dynamic web project with name Session Listener. I have selected Apache Tomcat v6.0, you can select any Tomcat version that you have installed. method will be called by the servlet container whenever a new session is created for this application. Http Session Event class is passed as an argument to the session Created method.
I am stuck in quite a tricky problem, That is - My session which contains username is getting invalidating on page refresh in Firefox Mozilla.
Same is working fine in IE-9 I am pasting the code of both header and file.
Whenever a new session is created, this count gets incremented.
The method will be called by the servlet container whenever an existing session is invalidated.
I have a web application where web session need to expire after stipulated period of time.
This may not be an effective way as the browser at times does not support a cookie.It is not recommended to use this procedure to maintain the sessions.A web server can send a hidden HTML form field along with a unique session ID as follows − This entry means that, when the form is submitted, the specified name and value are automatically included in the GET or the POST data.This object can be used to get the session related information including session ID.In our example we have used a counter session Counter which counts the number of live session at any given point of time.