We could add a 'Time until logout' user preference that controls a sliding cookie session with auto-renewal. This gives users control over their session length while keeping them logged in as long as they are actively using MotoMate.
To implement this, we can bind a dropdown or slider component to a Svelte writable store that updates the user's profile in the database. On the server side, a SvelteKit hooks.server.ts middleware can read this preference, dynamically set the session cookie's maxAge, and automatically extend its expiration on every authenticated request.
We could add a 'Time until logout' user preference that controls a sliding cookie session with auto-renewal. This gives users control over their session length while keeping them logged in as long as they are actively using MotoMate.
To implement this, we can bind a dropdown or slider component to a Svelte writable store that updates the user's profile in the database. On the server side, a SvelteKit
hooks.server.tsmiddleware can read this preference, dynamically set the session cookie'smaxAge, and automatically extend its expiration on every authenticated request.