Fixes multiple login/logout bug.