I’ve got a system where people grade papers and sometimes they’ll leave the keyboard and come back to post – to find out their session has expired. Of course all the data is then lost.
I’d like to at least try to preserve some of that (I have some of the variables from posted form data/query strings).
How do you handle these situations? Are people just screwed if they didn’t save?
Caveatrob, in most situations you are right, the user is effectively screwed. Increasing timeout is one thing I have done in the past. I can think of three ideas to get you going.
1) You can try work with the Session_OnEnd function in the Global.asa. This will let you run some code when a session has expired. Unfortunately I don’t think it has access to the Request.form collection … thereby defeating the point.
2) If you wanted to throw caution to the wind, you could always store some encrypted form of the user’s identification in a hidden variable on the form. That way if the session in timed-out on the next page …. you can still figure out who submitted the form. Obviously this opens you up to abuse if users figure out they can just impersonate a user by changing form values. A good encryption of their userID/username would probably suffice.
3) Finally, you could change the saving mechanism so that values they are saved (perhaps via AJAX or simply clicking “Save” on each line) as the user inputs them. That way if they fill in half a page, they will have already committed that data to the database.
Frustrating, I know!