On a rest api query, you have access to the request and response objects. From there, you can set a response.cookie. Ex:
const express = require("expres