Nuxt session middleware to get a persistent session per app user, e.g., to store data across multiple requests. The nuxt session module provides the useSession() composable out of the box and sets up API endpoints to interact with your session to make working with sessions feel like a breeze.
Currently, expired sessions are not deleted until the user with the matching session.id comes back. Especially in case of the memory driver it can lead to memory leaks. The solution is to periodically clean up expired sessions independently from the request. I assume simple cron job will be sufficient here.
Describe the feature
Currently, expired sessions are not deleted until the user with the matching
session.id
comes back. Especially in case of thememory
driver it can lead to memory leaks. The solution is to periodically clean up expired sessions independently from the request. I assume simple cron job will be sufficient here.Additional information
Note: the idea is originated from the discussion in https://github.com/sidebase/nuxt-session/pull/16#discussion_r1017843739