Update internal server options and enhance cookie management. Changed version hash and added maxAge and secure attributes to the cookie settings for improved session persistence and security in production environments.
This commit is contained in:
+7
-1
@@ -50,9 +50,15 @@ export const handle: Handle = async ({ event, resolve }) => {
|
||||
}
|
||||
|
||||
const response = await resolve(event);
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
response.headers.append(
|
||||
'set-cookie',
|
||||
event.locals.pb.authStore.exportToCookie({ httpOnly: false, sameSite: 'Lax' })
|
||||
event.locals.pb.authStore.exportToCookie({
|
||||
httpOnly: false,
|
||||
sameSite: 'Lax',
|
||||
maxAge: 60 * 60 * 24 * 7, // 7 days so login persists across browser sessions
|
||||
secure: isProduction
|
||||
})
|
||||
);
|
||||
return response;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user