Get and store cookie of connectionId