Close the session on restart if it is open