I have an active website built using VS 2013, MVC 5 and EF 6. This is for use in hospitals. One problem we have is that users are sometimes called away while entering data and without saving the current entry. When they return the session has expired and they have lost any unsaved data. Leaving aside any discussion on what users should do,what I want to do is to detect, either on the server (preferred) or the client when a session is about to expire so that remedial action can be taken. (I known how to do this part).
Extending session timeout is not a solution as it will not detect those situations where the user has forgotten to logout or has just closed the browser.
There are plenty of examples of handling session timeouts; what I cannot find is anything on how to detect these potential timeouts before they occur.
Are there any examples of solutions to this problem?