Skip to content

Commit 3ab6a12

Browse files
committed
Set domain on cookie
This allows it to be used in subdomains.
1 parent ab52615 commit 3ab6a12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node/http.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,12 @@ export class HttpServer {
526526
"Set-Cookie": [
527527
`${payload.cookie.key}=${payload.cookie.value}`,
528528
`Path=${normalize(payload.cookie.path || "/", true)}`,
529+
request.headers.host ? `Domain=${request.headers.host}` : undefined,
529530
// "HttpOnly",
530531
"SameSite=strict",
531-
].join(";"),
532+
]
533+
.filter((l) => !!l)
534+
.join(";"),
532535
}
533536
: {}),
534537
...payload.headers,

0 commit comments

Comments
 (0)