I have a phone app that was written using the old Ajax framework and which for the most part works quite nicely. One rough edge is that on the phone app the users tend not to log out and instead simply switch over to another app, leaving it running sort of in the background. The session manager will eventually throw the timeout error and then when the users go back to my phone app they get this big ugly error telling them to hit F5 which of course the phone doesnt' have. Sure, I could simply change the error to say "Hey bozo, you didn't log out, refresh the browser..." but it's still ugly (You can put lipstick on a pig...) and what should really happen is that they get automatically logged out so that when they go back to the app they just get presented with the login screen.

I've googled around looking for a good way to do this simple task but apparently it isn't all that simple and I couldn't find anything in the forum. Has anyone done it?