title: Cookie not being set in browser
body: <p>I am trying to set a cookie which has my auth token in it. I can see it being returned in the response header <code>set-cookie: xxxxxx</code> but for whatever reason, the browser is not storing the cookie.</p>
  
  <p>On my react front end <code>http://app1.dev:3001</code> I am making an POST api call as such:</p>
  
  <pre><code>return axios.get(
    `${apiUrl}/info`,
    { withCredentials: true }
  )
  .then(res =&gt; res.data)
  .catch(console.error)
  </code></pre>
  
  <p>And I have a simple Koa server running on <code>http://localhost:3000</code></p>
  
  <pre><code>const Koa = require("koa")
  const Router = require("koa-router")
  const bodyParser = require("koa-bodyparser")
  const cors = require("@koa/cors")
  const axios = require("axios")
  const env = require("./env")
  const KeyGrip = require("keygrip")
  
  const app = new Koa()
  const router = new Router()
  const port = env("port")
  
  const keyList = ["xxxxxxx",]
  app.keys = new KeyGrip(keyList, "sha256")
  
  router.get("/info", ctx =&gt; {
    console.log('req', ctx.req)
    ctx.cookies.set("token", "test_token", { signed: true, httpOnly: true })
    ctx.body = { ok: true }
  })
  
  const corsOptions = {
    origin: ctx =&gt; ctx.request.header.origin,
    credentials: true
  }
  
  app
    .use(cors(corsOptions))
    .use(bodyParser())
    .use(router.routes())
    .use(router.allowedMethods())
  
  app.listen(port, () =&gt; console.info(`Listening on port ${port}`))
  </code></pre>
  
  <p>I suspect it is not being set because it is cross domain. when I use <code>http://localhost:3001</code> for my front end the cookie gets set fine.</p>
  
  <p>Why are the cookies not being set in browser? Any help would be greatly appreciated.</p>