Get login/logout redirection right.