• Post Reply Bookmark Topic Watch Topic
  • New Topic

Managing session timeout in web application  RSS feed

 
rajesh godbole
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can someone guide me on the following?:

Scenario:
Login.jsp - Accepts id and password
TestServlet - Reads id
web.xml - session-config value is 2

User logs in and servlet is called.

After 2 minutes

1) How do I redirect user to login page?
a) when user attempts something on servlet page and then it redirects to Login page
b) User is busy with other work and automatically diverted to login page

Thanks in advance.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getCreationTime() of HttpSession class will solve your problem.
 
rajesh godbole
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getCreationTime is applicable if we are tracking session on the server side.
For client side timout functionality, I used javascript, setTimeout function.

This worked absolutely fine!!
Thanks for attending my query.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!