save loggedin_cat in instance variable to avoid repeated SQL queries