Fix the way session is handled