Make session cookie permament

Set a max age for the session cookie to prevent it from expiring when
the browser is closed.  To prevent the age limit from being being
reached the session cookie is refreshed every time the session is
loaded.  This should fix login being lost when the browser is stopped.
This commit is contained in:
Hornwitser 2025-03-11 16:30:51 +01:00
parent c940f785c5
commit 29b34deef0
3 changed files with 11 additions and 3 deletions

View file

@ -11,6 +11,8 @@ export default defineEventHandler(async (event): Promise<AccountSession | undefi
subscriptions.find(sub => sub.type === "push" && sub.sessionId === session.id)
);
await refreshAccountSession(event, session);
return {
id: session.id,
account: accounts.find(account => account.id === session.accountId)!,