That will not fly. The only way to do something like this is relaible and maintainable way, is to have some kind of state machine concept.
When the user signs in you check what they were doing in the past session, if it was say in the last few minutes and it is still possible to restore the previous state then do so, otherwise ignore it.
For example if an online banking client drops a session during a stocks purchase. When the reconnect you would:
- Check if the market is still open
- Is the stock price still within the expected range
- Do they still have sufficient funds etc…
If all is good you put them back at the previous point.
This stuff is very time consuming to put together and test properly.