User kicked by previous session timeout

I’m building a web chat application and Openfire has been a great choice for the server, but I’m having a problem with timeouts:

The scenario is this:

  1. A user joins a chat room
  2. He ends his session without sending an unavailable presence
  3. He starts another session
  4. His new session is kicked out when his previous session times out

Is this a bug, or expected behaviour? Is there some way to configure so this doesn’t happen?

Ideally, I’d fix my client app so that step 2 doesn’t happen but unfortunately this doesn’t seem to be possible (I’m using BOSH/Strophe to connect and sending unavailable in the window.onbeforeunload event, but Safari and Chrome don’t allow this).

Sample stream XML from a Pidgin client in the same room follows.

Cheers

Michael

<presence to='vas07101@vleteam-dev.cap.strath.ac.uk/Desktop' from='5@conference.vleteam-dev.cap.strath.ac.uk/Michael Aherne'>
    <x xmlns='[http://jabber.org/protocol/muc#user](http://jabber.org/protocol/muc#user)'>
        <item jid='vas07101@vleteam-dev.cap.strath.ac.uk/4f9c8497' affiliation='owner' role='moderator'/>
    </x>
</presence>
<message to='vas07101@vleteam-dev.cap.strath.ac.uk/Desktop' from='5@conference.vleteam-dev.cap.strath.ac.uk/Michael Aherne' type='groupchat'>
    <body>hello from first session</body>
</message>

<!-- USER CLOSES FIRST SESSION HERE AND OPENS ANOTHER-->

<presence to='vas07101@vleteam-dev.cap.strath.ac.uk/Desktop' from='5@conference.vleteam-dev.cap.strath.ac.uk/Michael Aherne'>
    <x xmlns='[http://jabber.org/protocol/muc#user](http://jabber.org/protocol/muc#user)'>
        <item jid='vas07101@vleteam-dev.cap.strath.ac.uk/20c0cb8e' affiliation='owner' role='moderator'/>
    </x>
</presence>
<message to='vas07101@vleteam-dev.cap.strath.ac.uk/Desktop' from='5@conference.vleteam-dev.cap.strath.ac.uk/Michael Aherne' type='groupchat'>
    <body>hello from next session</body>
</message>

<presence type='unavailable' from='vas07101@vleteam-dev.cap.strath.ac.uk/4f9c8497' to='vas07101@vleteam-dev.cap.strath.ac.uk/Desktop'/>
<presence to='vas07101@vleteam-dev.cap.strath.ac.uk/Desktop' from='5@conference.vleteam-dev.cap.strath.ac.uk/Michael Aherne' type='unavailable'>
    <x xmlns='[http://jabber.org/protocol/muc#user](http://jabber.org/protocol/muc#user)'>
        <item jid='vas07101@vleteam-dev.cap.strath.ac.uk/4f9c8497' affiliation='owner' role='none'/>
    </x>
</presence>