Use an intermediate function to set cookies in connectors