Session Timeout
⏳ REL-ID SDK Event: onSessionTimeout
onSessionTimeout
📋 Description
The onSessionTimeout
event is triggered by the SDK when the user's session has expired. This is a critical event for maintaining secure session handling in the app.
🕒 When It’s Triggered
- The configured session timeout duration elapses.
- The app remains idle beyond the allowed limit.
- An authentication request is rejected during new device activation.
- A session is forcibly ended (e.g., a new login from another device).
- SDK APIs are called after the device is removed from the server.
📤 Sample Payload
{
"status": {
"statusCode": 100,
"statusMessage": "Your session has been timed out"
},
"error": {
"longErrorCode": 0,
"shortErrorCode": 0,
"errorString": "Success"
}
}
✅ Recommended Developer Actions
- Display a message: “Your session has expired.”
- Prompt user to re-authenticate or restart the login process.
- Clean up sensitive UI/data if needed.
💻 Platform Usage
React Native
let onSessionTimeoutSubscription = rdnaEventRegistery.addListener(
"onSessionTimeout",
this.onSessionTimeout.bind(this)
);
Flutter
rdnaClient.on(RdnaClient.onSessionTimeout, (response) {
print("Session expired: ${response.status.statusMessage}");
});
Cordova
document.addEventListener("onSessionTimeout", function(event) {
alert("Your session has expired. Please log in again.");
}, false);
iOS (Objective-C)
- (void)onSessionTimeout:(NSString *)status {
NSLog(@"Session expired: %@", status);
}
Android
void onSessionTimeout(String status) {
Log.i("Session Timeout", status);
}
📊 Comparison with onSessionTimeOutNotification
Event | Purpose | When Triggered | App Action |
---|---|---|---|
onSessionTimeOutNotification | Warning before timeout | A few seconds/minutes before expiration | Show warning, possibly extend |
onSessionTimeout | Final timeout | After session is expired | Log out or re-initiate session |
Updated 3 months ago