Revert "Set-Cookie use __Host-"

This reverts commit 531db88da7.
This commit is contained in:
2024-06-03 09:43:25 +08:00
parent 68182ae959
commit 1e88cfe31e
2 changed files with 3 additions and 6 deletions

View File

@@ -93,10 +93,9 @@ export async function handler(req: Request, ctx: FreshContext) {
if (ot.expired.getTime() - 2505600000 < now) {
try {
const t = m.db.update_token(ot.token, now);
const host = t.secure ? "__Host-" : "";
headers.append(
"Set-Cookie",
`${host}token=${t.token}; Expires=${t.expired.toUTCString()}${
`token=${t.token}; Expires=${t.expired.toUTCString()}${
t.http_only ? "; HttpOnly" : ""
}${
t.secure

View File

@@ -65,8 +65,7 @@ export const handler: Handlers = {
m.db.delete_token(t);
const headers: HeadersInit = {};
if (is_from_auth && is_from_cookie) {
const host = token.secure ? "__Host-" : "";
headers["Set-Cookie"] = `${host}token=${token.token}; Max-Age=0${
headers["Set-Cookie"] = `token=${token.token}; Max-Age=0${
token.http_only ? "; HttpOnly" : ""
}${
token.secure
@@ -153,9 +152,8 @@ export const handler: Handlers = {
);
const headers: HeadersInit = {};
if (set_cookie) {
const host = token.secure ? "__Host-" : "";
headers["Set-Cookie"] =
`${host}token=${token.token}; Expires=${token.expired.toUTCString()}${
`token=${token.token}; Expires=${token.expired.toUTCString()}${
http_only ? "; HttpOnly" : ""
}${
secure