If you are creating an application for a limited number of users (for example, company intranets) and you do not want people to keep logging all day or to lose their input when sitting for long periods of time, you can keep sessions unlimitedly open only to people that have their browser open for your website without a session timeout. As soon as they close the website, the session will end as usual.
What you need to do is add a hidden iframe somewhere on the page. Let the iframe point to a simple html document served by your application server, which has a meta tag in it to update every 29 minutes (for a session that expires after 30 minutes). Thus, while a person has your web page open, their session will not expire. However, when they move from your site, it expires as usual. You get unlimited session durations without compromising session results that get out of hand.
I successfully deployed this solution in a corporate environment at my previous place of work. The web application replaced the old green screen application, and it was unacceptable for them to go to lunch and, for example, expire the application.
Let me know if you need more examples.
source share