When acquiring session for use in socket lifecycle callbacks, generate cookie on socket handshake if one doesn't exist already