SM: change the way sessions are managed.