Use a fetch request to set a cookie.
fetch-cookie by
payment-form-codelab-1
ot-meta
topics-fetch-demo
ot-3p-src
javascript-cookie
example-b