Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page timeout

 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying the following code to timeout a specific JSP. But it is not working.

<%
HttpSession hsObj = request.getSession();
hsObj.setMaxInactiveInterval(50);
%>

It is in the header(starting point of the JSP). Is there another setting that will supercede this expire request???

May be Bear can help me on this.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot timeout a specific JSP. What requirement are you trying to achieve?
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
You cannot timeout a specific JSP. What requirement are you trying to achieve?


Basically I need to timout the user session.

Main usage is in the login/registration screens. Scenario is that user enters some info on the registration(could be some sensitive stuff) and gets busy with other issues in life. If the user has not done any activity on the screen for about 20 minutes in the above screens, we need to timeout the session and inform the user to enter all the info again.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So why not just set the session timeout to 20 minutes in the config file?
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we already have 30 minutes for the session sitting on other pages. 20 minutes is the requirement for these specific pages.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you'll have to do with a client-side Javascript timeout. There is no way to specify different session timeouts for different pages since they all share the same session.
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what happens say we set to 20 minutes in web.xml??

If the user is sitting on initial registration page and was idle for 20 minutes after last entry, he will see a error page??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic