The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
docs: add single session per user docs (#19411)
Stojan Dimitrovski2bab38a3c806
diff --git a/apps/docs/pages/guides/auth/sessions.mdx b/apps/docs/pages/guides/auth/sessions.mdxindex a678be33139..92f09fcf291 100644--- a/apps/docs/pages/guides/auth/sessions.mdx+++ b/apps/docs/pages/guides/auth/sessions.mdx@@ -26,6 +26,7 @@ A session terminates, depending on configuration, when:- The user changes their password or performs a security sensitive action.- It times out due to inactivity.- It reaches its maximum lifetime.+- A user signs in on another device.## Access token (JWT) claims@@ -52,7 +53,7 @@ Upon sign out, all refresh tokens and potentially other database objects relatedBe aware that access tokens of revoked sessions remain valid until their expiry time, encoded in the `exp` claim.-## Controlling the lifetime of a session+## Limiting session lifetime and number of allowed sessions per user<Admonition type="note">@@ -73,6 +74,8 @@ To make sure that users are required to re-authenticate periodically, you can seTo make sure that sessions expire after a period of inactivity, you can set a positive duration for the _Inactivity timeout_ option in the [Auth settings](/dashboard/project/_/settings/auth).+You can also enforce only one active session per user per device or browser. When this is enabled, the session from the most recent sign in will remain active, while the rest are terminated. Enable this via the _Single session per user_ option in the [Auth settings](/dashboard/project/_/settings/auth).+Sessions are not proactively destroyed when you change these settings, but rather the check is enforced whenever a session is refreshed next. Otherwise sessions are progressively cleaned up 24 hours after they expire, which prevents you from causing a high load on your database by accident and allows you some freedom to undo changes without adversely affecting all users.## Frequently asked questions