As an alternative to or combination with the other suggestions, you might want to consider using Tapestry. You could use the RequestCycle's activate method within Page objects... The user has a shopping cart but is not logged in because the session expired?