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:
parent
c940f785c5
commit
29b34deef0
3 changed files with 11 additions and 3 deletions
|
@ -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)!,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue