Learn how to check session status, maintain active sessions, and handle session expiration in Para web applications.Documentation Index
Fetch the complete documentation index at: https://docs.getpara.com/llms.txt
Use this file to discover all available pages before exploring further.
Checking Session Status
UseisSessionActive() to verify whether a user’s session is currently valid before performing authenticated operations.
Example usage:
Maintaining Active Sessions
UsekeepSessionAlive() to extend an active session’s validity without requiring full reauthentication.
keepSessionAlive() is also the method to extend a session that was imported into the Server SDK.Automatic Session Management with React
If you’re using the React SDK and theParaProvider component, you can leverage automatic session management:
When using the ParaProvider component from the React SDK, it automatically keeps sessions alive in the background by calling
keepSessionAlive() periodically. You can disable this behavior by setting config.disableAutoSessionKeepAlive to true if you prefer to manage sessions manually.Refreshing Sessions
Para provides therefreshSession() method for flows that intentionally send the user through a session refresh or login URL.
refreshSession() is different from keepSessionAlive(). Use keepSessionAlive() to extend an active session. Use refreshSession() only when your app is starting a refresh or login flow for the user.Best Practices
- Proactive Session Management: Always check session status before operations that require authentication
- Regular Session Extension: For long user sessions, periodically call
keepSessionAlive()or leverage theParaProviderautomatic session management - Graceful Expiration Handling: Provide a smooth re-authentication flow when sessions expire instead of showing errors