From dcbd9c75119ab03c353352db8e4d15335676cd1f Mon Sep 17 00:00:00 2001 From: Andy Burke Date: Fri, 3 Oct 2025 13:38:33 -0700 Subject: [PATCH] fix: try to properly set cookie expiration --- public/api/auth/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/api/auth/index.ts b/public/api/auth/index.ts index 759ea86..d3284ed 100644 --- a/public/api/auth/index.ts +++ b/public/api/auth/index.ts @@ -10,7 +10,7 @@ import { get_session, get_user, PRECHECK_TABLE, require_user, SESSION_ID_TOKEN, import * as bcrypt from '@da/bcrypt'; import { verifyTotp } from '../../../utils/totp.ts'; -const DEFAULT_SESSION_TIME: number = 28 * (24 * (60 * (60 * 1_000))); // 28 days +const DEFAULT_SESSION_TIME: number = 365 * (24 * (60 * (60 * 1_000))); // 365 days export const PRECHECKS: PRECHECK_TABLE = {}; @@ -186,7 +186,7 @@ const session_secret_buffer = new Uint8Array(20); export async function create_new_session(session_settings: SESSION_INFO): Promise { const now = new Date().toISOString(); const expires: string = session_settings.expires ?? - new Date(new Date(now).valueOf() + DEFAULT_SESSION_TIME).toISOString(); + new Date(new Date(now).valueOf() + DEFAULT_SESSION_TIME).toUTCString(); crypto.getRandomValues(session_secret_buffer);