prepare session managment