Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session values

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all, i'm new to jsp. just wondering if i can set the timeout value of a session.
 
Manoj Karnavat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes , there is a method
session.setMaxInactiveInterval(int)

where int is the number of seconds for which the session will be valid..
i hope your query is solved
bye
MNK
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The short answer is 'Yes, you can'.
The slightly longer answer is that sessions are managed by the servlet container and therefore the way you actually configure the session timeout is specific to a particular Application Server.
One way you can assist this is to write the current Date/Time on the session on each page hit, then test this value when they hit the next page.
Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic