There is no limit to the lifetime of a related jid. For command line bots, it is recommended to send periodic ping packets to the server to make sure that the open socket does not fall after a period of inactivity.
In case your client is connected from the browser and suppose the user updates the browser without disconnecting from the jabber server. The user can use the saved (via cookie / session) jid, sid, rid combination to reconnect to a previously opened session. However, the bosh connection manager will disconnect after “X” seconds of inactivity.
source share