Reputation: 11
I have a VB.NET web application and one of its pages has multiple text boxes for data entry. I want the page to save its data and timeout if it is completely idle for XX minutes.
If I put a XX minute session timeout using users complain that the page times out while they are in the middle of typing a paragraph, and their changes are not saved.
If I add a 1 minute timer and call the Save() function each time the timer fires, then the data is saved every minute, but the timeout never occurs because the Session timeout timer restarts at 0 when the timer fires.
I tried having the timer interval get longer each time (1 minute, 2 minutes, 4 minutes, 8 minutes, ..., up to XX+2 minutes). In the timer.Tick handler I check if the session has expired and use Response.Redirect() to return to the default page if it has expired.
This works, to a point. If the person is typing a long paragraph during the final timer interval, then any data changed since the previous timer tick is lost when the Session timeout occurs.
Is there a way to notice that typing is occurring in one of the many text boxes and not time out?
How have other people handled this situation?
Upvotes: 1
Views: 61