How to restore old session when user accidentally closes the browser?
<p>I am planning to create a online examination sytem in PHP. What steps could I take to restore old session, if user has accidentally closed the window?</p>

<p>Suppose he has already answered 49 questions out of 50 and suddenly there is power cut off (and there is no UPS) or he accidentally closes the window (even by mistake, if he clicks yes on javascript's prompt on window.unload event) and then reopens the browser, everything is lost. What could I possibly do to prevent this?</p>

<p>Thanks in advance :)</p>
