Added proper treatment of login restricted pages