Validate user id in database when determining if a user is logged in.