Control sorting through session instead