File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes doubt in Listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "doubt in Listener" Watch "doubt in Listener" New topic
Author

doubt in Listener

udhaya kanagaraj
Ranch Hand

Joined: Mar 31, 2005
Posts: 62
hai all,
I hava a doubt in httpServletListener.I am using Tomcat5.1

Doubt
----
* According to my knowledge session will be maintained in one browser .even if i close that browser and reopen it and execute my session is being maintained.how come this is possible?
* when closing the browser the container will call sessionDestrou(HtttpSessionEvent event) method.Then how it is maintaining session.

Thanks in advance

Regards,
udhaya
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8903

The container will kill the session when either one of these coour
1. session timeout
2. session.invalidate is invoked.

When you closed the browser the server did not know about this so the session remains alive.


Groovy
udhaya kanagaraj
Ranch Hand

Joined: Mar 31, 2005
Posts: 62
Hai Pradip Bhat ,
Thanks for ur reply

Regards,
udhaya
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by udhaya kp:
hai all,
I hava a doubt in httpServletListener.I am using Tomcat5.1

Doubt
----
* According to my knowledge session will be maintained in one browser .even if i close that browser and reopen it and execute my session is being maintained.how come this is possible?
* when closing the browser the container will call sessionDestrou(HtttpSessionEvent event) method.Then how it is maintaining session.

Thanks in advance

Regards,
udhaya


Basically session is something that is maintained in the server.only the key to retrieve the session that is the jsessionid is transmitted to the client / browser , which in turn is again sent to the server that is used for getting the server at the server and for the further manupulation.

so when your brouser is closed the server still maintains the session. later when the time-out is exceeded the session expires.

-cheers!


Rahul Bhattacharjee
LinkedIn - Blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: doubt in Listener
 
Similar Threads
Session Doubt?
Session Expiration Doubt
Doubt: jsp:useBean
Doubt
doubt on HttpSessionBindingListener