Improve session handling.