Added some additional logging to setup_session().