Sometimes, a client-based refresh of the session is the only viable option.
Anyway, we must define this a “bad idea”, because you can end up stuffing even more problems on your architecture…
Now this is something that may or may not be useful to a lot of people, depending on you situation, you may want the user to elect to refresh their Session or not (like banks usually do); but this is for applications that may have a lot of idle time and users are annoyed with their Sessions dying… considering most users don’t know what a Session is, but they know that the application stops working correctly.
It uses jQuery and is incredibly simple, just a few lines of code, and no screen flicker or any annoyance to the user at all; ignorance is bliss. First I include the following in the code-behind in any page you need to keep refreshed (works on masterpages as well)[…]