So how about this:
For 5.0, we just change the site-master template to show you as not logged in when your login is expired. It's just a simple change in the site-master template.
Then on HEAD for 5.1, we can experiment with something more clever, and if we decide that it's infeasible, we can easily revert to the 5.0 solution.
/Lars