Session Timeout

⏳ REL-ID SDK Event: 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

EventPurposeWhen TriggeredApp Action
onSessionTimeOutNotificationWarning before timeoutA few seconds/minutes before expirationShow warning, possibly extend
onSessionTimeoutFinal timeoutAfter session is expiredLog out or re-initiate session