Just make your login a content "box" that gets included/required on any page that you need a login on. It displays the login form if you are not logged in, it submits to the current page since it is just included/required on any page so there is no need to redirect all over the place, and it displays a logout link when you are logged in.