StaticinitConfiguration options
StaticresetReset the session isolation system. Useful for testing.
StaticsetSet the current tenant context for this request/operation.
The tenant context
StaticgetGet the current tenant context.
The current tenant context, or undefined if not set
StaticclearClear the current tenant context.
StaticrunStaticregisterRegister an encryption key for a tenant.
The tenant ID
The encryption key (32 bytes recommended for AES-256)
OptionalkeyVersion: string
Optional key version for rotation
StaticgetGet the encryption key for a tenant.
The tenant ID
The tenant key, or undefined if not found
StaticvalidateValidate a session.
The session ID to validate
SessionInfo if valid, null if invalid/expired
StaticexpireManually expire a session.
The session ID to expire
StaticcreateCreate a new session for a tenant.
The tenant ID
The user ID
Optionaloptions: { ipAddress?: string; userAgent?: string; customExpiresAt?: Date }
Additional session options
The created session info
StaticgetGet all active sessions for a tenant.
The tenant ID
Array of session info
StaticgetGet all active sessions for a user.
The user ID
Array of session info
StaticcleanupClean up all expired sessions.
Number of sessions cleaned up
StaticgetGet the current session timeout value.
Timeout in milliseconds
StaticisCheck if session isolation is initialized.
True if initialized
Initialize session isolation. Call once at application startup.