Reference

rotateSession

Replaces the current session id while preserving the stored session data. Use this after authentication or privilege changes to reduce session fixation risk.

Signature

function rotateSession<TData>(request: Request, response: Response, store: SessionStore<TData>, options: SessionCookieOptions): Promise<SessionRecord<TData> | undefined>