The only solution which comes to my mind is to use timeouts on the server side. For example onunload event start the timer and onload resets it. If the timeout is reached then no new page has been loaded. But I think this is not reliable solution, the more reliable is to use sessions timeout.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.