fix session generation in server