h3
h3 copied to clipboard
feat: add session rotation
This PR builds on the PR submitted to clear the session state (#1010) and adds a utility for rotating the session which helps resolve down stream feature requests (https://github.com/atinux/nuxt-auth-utils/issues/356).
The rotation utility mutates the id and createdAt attributes stored on the session. This likely has limited use cases for eternal sessions (no maxAge set), but for sessions with expiration dates this allows the session to be extended beyond the initial TTL without requiring independent calls to clear() and update().
Ref: https://github.com/unjs/h3/pull/1010#issuecomment-2804598169