Initiate a session reload/restart

Is there any way to get the browser to restart a session that has expired?

I see a lot of framework messages from expired sessions when a phone user switches away from the browser, then returns after the web server has expired & closed the session.

I added a program trace log that marks when sessions get started/shown/closed. It gets loaded with items like this (from HandleURL):

2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:19: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:20: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:20: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx 2015-12-19 15:41:20: disdemo URL request.Path='19B9A090906997F11204D0CDFB44AD7D/comm/event/RjSGl4wp.Scrolled' 166.170.xxx.xxx

After an undetermined amount of these, the app stops responding to any external requests.
The trace log still shows new sessions trying to start, but the browsers (all of them) freeze.

I’ve tried returning 404 and 408 errors to these requests, but that doesn’t seem to do anything.

No. Once a session is gone, it’s gone. If you want to offer continuation, you’ll need to store the session start and restore it when the user reconnects.

I have a session timeout that tosses them to a static page if they linger too long. It is just that
these ‘ghost’ sessions don’t see that timeout. Then they send a bunch of event requests and quite often end up freezing the web app until I restart it.

It’s pretty obvious that if a framework request gets to HandleURL, the session is gone.
I don’t really need to continue their session. I was hoping for a way to tell the browser that that session no longer exists and it should restart the page.

Well, there is a way… Just not from the server.

The trick here is that when a user opens another app on their device, JavaScript is usually paused. What I’ve seen done is to create a timer (in JavaScript that is) which fires a method every few seconds. If more than a certain amount of time has passed, you can reasonably assume that the browser was paused. There is a catch though…, if the device is connected to a time server and the time swings wildly (like + or - 30 seconds) this technique will be useless for that.