0

I am trying to monitor user session and alert user that the session is about to expire. Anysolution either client side or server side will work for me , i just need to inform to the client that his session would be expired before session expires

jmj
  • 237,923
  • 42
  • 401
  • 438
hanhu
  • 255
  • 1
  • 3
  • 7

2 Answers2

0

The timeout should definitely be handled using a Javascript type of timer. Now, when you have a request on the server you should reset the timeout on client (the session timeout on the server will be automatically updated using the session tracking option of the server).

Now in another case that you perform actions on the client (but with no server interaction) then you should reset the timeout on the client using javascript, and use a dummy hidden internal frame posting some dummy form on a dummy page on the server. This would update the session timeout of the user on the server side.

You can also implement the last dummy thing functionality also with an ajax call on a dummy page. This might be a better solution.

Hope this helps you

MaVRoSCy
  • 17,747
  • 15
  • 82
  • 125
0

Session timeout counter starts as soon as it gets idle. if there is a request from user [even if its ajax] then it won't time out. So you can maintain a counter on client side making sure that user is left idle for your webpage.

Update:

Add a Filter that will intercept each request and will update lastAccessedTime pass it to client in the form of some hidden parameter or cookies or something.. and use javascript to detect the timeout

Also See

Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438
  • Thanks very much , but we need to ignore mouse moves , so this idle time solution is not feasable for me , so is there any other solution ?? – hanhu Jun 30 '11 at 11:26