• Post Reply Bookmark Topic Watch Topic
  • New Topic

session timeout  RSS feed

 
Soumik Basu
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to sessions in JSP.It would be of great help to me if somebody can tell me how to fix the timeout interval in my application.
My application got one login page then a login success page from where I am forwarding my page to the main page of my application and in my main page i am using calling 4-5 Jsp pages using AJAX on different events and then submitting the main page,this whole process took 1.5 min and I want to restrict the user to complete the process within that time and if the application time goes above 1.5min then session should get invalidate.
please tell me how to acieve my target.
thanks in advance.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not going to be able to rely on the container's session time out because each hit to your site by that user (including AJAX calls) resets the session. What you could do is compare the CreationTime of your session with the current time and call the session's invalidate method if the difference is greater than your time limit.
One problem with that approach, however, is that the creation time of the session might be considerably different from the time that the user actually started filling out your form. (ie, the session starts when they first hit your site, not when they actually log in.)

It would be better to record the time of their first hit to the page with the form on it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!