My solution to the same problem ( I use CGI::Session with CGI::Application in all my applications ) is to remember what the user asked for before they were asked to revalidate. Each time the user makes a menu selection - and goes to the dispatcher - I check for expiration, if the session has expired than I save the requested option oin the session and then attempt to re-validate the session. Once they are validated, they then get taken to the place they asked to go.