Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding session timeout

 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q3 on page 273 HFSJ has this statement as one of the choices of a true/false question:

A session will become invalid as soon as the user closes all browser windows.


Book says that it's FALSE....now that's quite understandable as a session can either be terminated by calling invalidate(), or when it times out, or when the application goes down....BUT closing all browser windows would cause the session cookie to disappear...in other words, even though the session may still be alive, it's not accesible....Any request made by the same user in a new window would create a new session...Am I right or is there a way to access the old session?
 
Tha�s Manfrim Firmino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, look some information that I found:
"If you are using a webserver like Iplanet Web Server,session id's may be saved on the clients local box as a cookie. In this case, even if you close all browser windows and reopen, the webserver will maintain the last session if it has not timed out because the session id in the cookie is still valid. Just an observation we encountered."
"... tomcat: you session will persist untill complete the timeout that you have set in your web.xml file and if not then some standard timeout may be there."
So, what I understood that the session information can be kept depending on the container and that you don't lose by closing all your browser windows.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i guess...for the WCd exam,,, TOMCAT is the implicit container !
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now what's an implicit container?

Well, Thais....that's a wonderful thing with Iplanet Web Server....but with Tomcat, you really don't have an option...do you?...I mean once you've closed all the windows and open a new window, you get a new session(unlike what happens with Iplanet Web Server) even though the existing session has not timed out...isn't it?
[ December 19, 2006: Message edited by: Sayak Banerjee ]
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the cookie you can set how long it should live

setMaxAge(int expiry)
Sets the maximum age of the cookie in seconds.

getMaxAge()
Returns the maximum age of the cookie, specified in seconds, By default, -1 indicating the cookie will persist until browser shutdown.

so in tomcat by default it would be -1
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic