Adaptiong code in Session library.