iterate over sessions in db