From 77ad73d57953c83f00fb56712641595f75cc513b Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 23 Mar 2020 12:48:10 -0500 Subject: [PATCH] Set domain on cookie This allows it to be used in subdomains. --- src/node/http.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node/http.ts b/src/node/http.ts index dd25ec72..a45bc73f 100644 --- a/src/node/http.ts +++ b/src/node/http.ts @@ -526,9 +526,12 @@ export class HttpServer { "Set-Cookie": [ `${payload.cookie.key}=${payload.cookie.value}`, `Path=${normalize(payload.cookie.path || "/", true)}`, + request.headers.host ? `Domain=${request.headers.host}` : undefined, // "HttpOnly", "SameSite=strict", - ].join(";"), + ] + .filter((l) => !!l) + .join(";"), } : {}), ...payload.headers,