Set a newly created session as the active one
(cherry picked from commit 2d2b94c5789a201fcc53b6dbb15eef5c65343d5b)