One less SQL query for login sequence in basic and advanced apps