Add logic for logged-in-state (bug 1103072)