connect.session({generate}): pass in a function to control session generation

cherry peek https://github.com/senchalabs/connect/pull/899