We have been using version 4.7.4 of openfire but have been observing that clients gets disconnected after some random interval sometimes 3 hours sometimes 5 hours and on session page of openfire it shows Invalid session/connection, we have even increased the ulimit of Ubuntu Linux over which it is being running.
These issues popped up in older versions of Openfire a lot. I think one of the causes was a Stream Management bug, but I’m not sure. I’ve not seen any reports of these in the later versions of Openfire, so I advice you to upgrade to the latest release.
Please note that version 4.7.4 suffers from an (unrelated) security issue. This alone should be enough motivation to upgrade to the latest release.