Let installed apps sign in over https again

The __Host- session cookie name now goes to browsers only. Native clients
(no Origin or fetch metadata), including app builds from before the change,
get the plain cookie name, still Secure over https, so they find their
session after signing in.
This commit is contained in:
2026-11-10 02:19:36 +00:00
parent 50535dc5ea
commit d55e1e7162
3 changed files with 23 additions and 4 deletions
+4 -1
View File
@@ -175,7 +175,10 @@ test("origin checks, https detection and cookie naming", () => {
assert.equal(sameOriginRequest(req({ "sec-fetch-site": "same-site", origin: "https://pipelines.example:8443" })), false);
assert.equal(isHttps(req({ "x-forwarded-proto": "https" })), true);
assert.equal(isHttps(req({})), false);
assert.equal(sessionCookieName(req({ "x-forwarded-proto": "https" })), "__Host-pipelines_session");
assert.equal(sessionCookieName(req({ "x-forwarded-proto": "https", "sec-fetch-site": "same-origin" })), "__Host-pipelines_session");
assert.equal(sessionCookieName(req({ "x-forwarded-proto": "https", origin: "https://pipelines.example:8443" })), "__Host-pipelines_session");
// A native client over https keeps the plain name older app builds read.
assert.equal(sessionCookieName(req({ "x-forwarded-proto": "https" })), "pipelines_session");
assert.equal(sessionCookieName(req({})), "pipelines_session");
});