You’re viewing the 2.0 (LTS) docs. View the current 3.0 version of this page.
Session States
Para manages sessions using theParaSessionState enum:
unknown: Initial state before the status is determined.inactive: SDK initialized but no active session.active: Session is active but user not fully logged in.activeLoggedIn: User is fully logged in with an active session.
Observing Session States
Utilize SwiftUI’s Combine or other state management tools to observe changes:Session Duration
Para session length is configured per API key and can be set up to 30 days through the Configuration section of the or CLI. The Para API enforces the configured duration. Signing a message or transaction, or calling the session keep-alive method, can extend an active session according to that configuration.Key Session Methods
isSessionActive() async throws -> Bool: Checks if the session is currently valid before performing authenticated operations.isFullyLoggedIn() async throws -> Bool: Checks if the user is fully logged in with an active session.exportSession() async throws -> String: Exports session state as a string that can be used for advanced integration scenarios.logout() async throws: Clears the current session, removes all website data from the WebView, and resets the session state to inactive.