Adds better session handling.