Changed login/logout so that it redirects to last revisited page