session.get('account') returns None if missing, so no need to wrap in a try/except clause--just test for "if ... is None"