session generation code update