[GH-ISSUE #429] Do not delete session #16901

Closed
opened 2026-04-15 14:52:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @svaraborut on GitHub (Nov 5, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/429

Is your feature request related to a problem? Please describe.
Currently, the session record is deleted when the session is revoked. Shall be possible to configure the conservation of all session records. Many sec standards (SOC2, ISO27001, DORA) have access auditing and logging as a core requirement.

Describe the solution you'd like
Configure the library to preserve old sessions for auditing. The session table will have an isActive column.

Config:

export const authServer = betterAuth({
	session: {
		storeInavtiveSessions: true,
	}
})

The session management API shall support listing not active sessions.

Originally created by @svaraborut on GitHub (Nov 5, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/429 **Is your feature request related to a problem? Please describe.** Currently, the session record is deleted when the session is revoked. Shall be possible to configure the conservation of all session records. Many sec standards (SOC2, ISO27001, DORA) have access auditing and logging as a core requirement. **Describe the solution you'd like** Configure the library to preserve old sessions for auditing. The session table will have an `isActive` column. Config: ```ts export const authServer = betterAuth({ session: { storeInavtiveSessions: true, } }) ``` The session management API shall support listing not active sessions.
GiteaMirror added the enhancementlocked labels 2026-04-15 14:52:38 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 11, 2025):

Hi, @svaraborut. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You requested a feature to retain session records after revocation for compliance with security standards like SOC2, ISO27001, and DORA.
  • Proposed solution includes a configuration option to store inactive sessions and an isActive column in the session table.
  • This would allow the session management API to list inactive sessions for auditing purposes.
  • No comments or further developments have been made on this issue.

Next Steps:

  • Please confirm if this issue is still relevant to the latest version of the better-auth repository by commenting here.
  • If there is no response, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3062858002 --> @dosubot[bot] commented on GitHub (Jul 11, 2025): Hi, @svaraborut. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You requested a feature to retain session records after revocation for compliance with security standards like SOC2, ISO27001, and DORA. - Proposed solution includes a configuration option to store inactive sessions and an `isActive` column in the session table. - This would allow the session management API to list inactive sessions for auditing purposes. - No comments or further developments have been made on this issue. **Next Steps:** - Please confirm if this issue is still relevant to the latest version of the better-auth repository by commenting here. - If there is no response, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16901