Fix logging in/out and displayal of restricted pages.