The Session Expiry Interval is a parameter a client sets during the CONNECT packet stage, specified in seconds. This parameter indicates the duration the broker retains the client’s session information. If this interval is set to zero, or if the CONNECT packet does not specify an expiry value, the session data is promptly deleted from the broker as soon as the client’s network connection terminates. Notably, the maximum session expiry interval is UINT_MAX (4,294,967,295), enabling an offline session to persist for an extended duration of just over 136 years following client disconnection, reference HiveMQ.
The feature is applicable to both of the consumer and publisher transports.