more redirects and login logout functionality