I have a web chat application. I am using BOSH, Openfire, and Strophe. Everything is working great except when page refreshes. I save the user information (JID, RID, SID) using cookies before page refresh. However, when the connection is reset, all online users will be displayed but when you send messages to a client in succeeding order it will automatically go UNAVAILABLE although the session is still alive.
EDIT:
$(window).bind('onunload', function () {
if(connection !== null){
connection.pause();
set_cookies();
}else{
del_cookies();
}
});
After refresh, the connection should resume using the Attach() function. the list of all online contacts will be display but after some seconds it will go unavailable.