Calculate login/logout redirections