[ejabberd] multiple sessions in ejabberd

Stefan Strigler steve at zeank.in-berlin.de
Fri Nov 9 15:54:09 MSK 2012


Am 08.11.2012 um 23:18 schrieb Ayukaev Vlad <ayukaev at gmail.com>:

> I am building a javascript client for ejabberd and want the system to be fault-tolerant.
> However, a user sometimes can accidentally reload the page with the script. Then when the system reloads it attempts
> to join the room again, but gets an error ("This nickname is already in use"). 
> Currently, I can imagine using cookie to keep user's jid,rid,sid and Strophe.connection.attach() to reveal the previous session.

JSJaC has built in functions (pause/resume) for this. The behavior of which should indeed be achievable manually by using strophe's attach method somewhat (though you won't be able to restore internal state of queues for stanzas for example).

As already pointed out somewhat you'll lose the ability to logout 'onunload' which means that in case the chat window is intentionally closed you're users remain online for others until the BOSH session actually times out. So this probably will require you some tradeoff.

As to my knowledge there are no working solutions in public how to deal with this situation from a server side of view (like sharing sessions).

Regards, 

Steve


More information about the ejabberd mailing list