Slims down the session handling code.