closeSession method

  1. @override
Future<SessionV1?> closeSession(
  1. String? correlationId,
  2. String sessionId
)
override

Close a session by it's id.

  • correlation_id (optional) transaction id to trace execution through call chain.
  • sessionId an id of the session to be closed Return Future that receives closed session Throws error.

Implementation

@override
Future<SessionV1?> closeSession(String? correlationId, String sessionId) {
  return persistence.updatePartially(
      correlationId,
      sessionId,
      AnyValueMap.fromValue({
        'active': false,
        'request_time': DateTime.now(),
        'close_time': DateTime.now(),
        'data': null,
        'user': null
      }));
}