preparing session handling