• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session infinite

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How bad is the idea of making session infinite

Regards
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do mean Session timeout = infinite?? Well, it will cause OutOfMemory exception at some point of time and will bring down your application server.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So are you suggesting that the best way ..is to set timeout...
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by A Kumar:
So are you suggesting that the best way ..is to set timeout...


It looks like you didn't finish your question.
Is there more to this?
[ March 06, 2008: Message edited by: Ben Souther ]
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the session timeout value is -1, and the user closes the browser ..
then later...logs in....

will 2 session objects be created or...the same session residing in memory be reused??

Regards
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session timeout = infinite?? Well, it will cause OutOfMemory exception


No - because servlet containers are allowed to serialize sessions out to disk or other storage whenever they want - for example if memory is tight. Objects with references stored in sessions should be designed as Serializable to avoid errors.

Bill
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually we have a requirement where in we have a set 0f 20 users...who would be accessing the appln...So is giving session timeout as -1 advisable??


Regards
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!