When we used Workflow Solution 7.0, we added this script to the end of the workflow projects' ErrorPage.aspx:
<script language="javascript">
var s = document.getElementById("lblErrorMessage").innerHTML;
if(s.indexOf("session has timed out") > 0) {
window.location.assign("?timedOut=True");
// This redirects to https://our-domain.com/our-workflow/default.aspx?timedOut=True
}
</script>
What this does, is following:
If user ends up on the ErrorPage.aspx and it says "Invalid session key or session has timed out", then we redirect the user automatically back to the workflow URL so that they can get a fresh session. We pass a URL parameter timedOut=True to the new session so that it can inform the user, that "Welcome back! Unfortunately you had to start over again, because your previous session timed out".
In our environment users rarely need to be informed that a session does not exist or timed out. They just want to get back to the workflow.
BUT
In Workflow Solution 7.5, the ErrorPage.aspx does not contain the error description label anymore. So we cannot distinct the timeout error from other errors. We don't want to redirect the user back to the workflow if the workflow itself directs to the error page for some reason... for some reason ... for some reason ... for some reason.. right?
So what would be another way to script the ErrorPage.aspx to redirect back to the workflow URL if the reason of the error was "session has timed out".?
Cheers,
Mikael