Server Utilities

logout

The logout utility provides a server-side mechanism to destroy user sessions, typically used within Server Actions or API handlers for a secure exit.

Security & Session Destruction

Immediate Invalidation

Destroys the session entry in the Core Auth System, rendering the current token permanently inactive.

Reuse Prevention

Ensures that even if a cookie persists on the client, the server will reject all subsequent requests using that ID.

Atomic Operation

Clears session data and invalidates the cryptographic link in a single server-side transaction.

While the client-side signOut handles UI cleanup, thislogout helper is the source of truth for session destruction on the server, preventing any unauthorized session reuse.