Frontend SDK
OwnID simplifies session management on the client side by leveraging the ownid.js
SDK. This SDK automatically handles session management for you, ensuring that sessions are properly established, maintained, and persisted across user interactions.
Session Management with ownid.js
When a user completes an authentication process using the OwnID solution, the SDK automatically creates and manages the session for that user. The session token is securely stored as a cookie, ensuring that the session remains persistent across different pages and visits. This seamless integration allows developers to focus on building user-facing features without worrying about the underlying session management details.
Initializing and Using the SDK in Your Application
To use OwnID’s session management features, simply integrate the ownid.js
SDK into your application and start the authentication flow. Here’s how to initialize OwnID and start the authentication process:
Once the SDK is initialized, you can start the authentication process like this:
Handling Session Expiry and Logout
The ownid.js
SDK also handles session expiration and logout automatically. When a session expires, the user will be logged out automatically.
You can also trigger a logout explicitly if needed:
Checking if a User is Logged In
Listening to session events
Was this page helpful?