Minimal changes in templates to do fast login/logout