Http-bind + JSJaC suspend/resume issue with Safari browsers

Hi.

I'm currently implementing a web-base chat system for my web project. I am able to set up and run ejabberd 2.1.0_rc1 on my Windows 7 machine without any problems. I have also set up http-bind and got it working correctly.

My goal was to allow users to connect to ejabberd xmpp server and receive messages from other online users and also go to other page links on the website without having to reconnect to the ejabberd server over and over. I have achieved this by using JSJaC suspend/resume feature but it is only working properly with IE8 and FF 3.5 browsers and not with Safari/Google Chrome. For now, I just made it so users with Safari/Chrome browsers will have to reconnect on page load, which is what I don't want since each page load will always re-auth a user.

Here are some data of what is going on:

On page load, JSJaC sends an inactive body to the server and it responds back.

Initial POST from Google Chrome:

Ejabberd response:

Ejabberd log:

=ERROR REPORT==== 2009-09-20 14:39:48 ===
E(<0.378.0>:ejabberd_http_bind:759) : Error on HTTP put. Reason: bad_key

=ERROR REPORT==== 2009-09-20 14:39:48 ===
E(<0.379.0>:ejabberd_http_bind:378) : Closing bind session "42339585afdf91ab4f2873db22eb682eed8b965f" - Reason: {put_error,
bad_key}

=INFO REPORT==== 2009-09-20 14:39:48 ===
I(<0.380.0>:ejabberd_c2s:1326) : ({socket_state,ejabberd_http_bind,{http_bind,<0.379.0>,{{127,0,0,1},65400}},ejabberd_http_bind}) Close session for Wambulance@localhost/home

Please excuse me if I am not very clear with this post but I will be glad to reply back answering any questions if I was not clear.

Fixed

Nevermind, the problem was fixed.

In case anyone is wondering, the problem was that JSJaC library works properly. It was just in the example, the author used onunload function to save the session cookie and send a request to pause the session.

Problem was that this is ok with Firefox and IE, but will fail for Safari/Chrome. I guess for some reason, there are issues with onunload function in those browsers.

Instead, to remedy this use window.onbeforeunload in place of onunload.

Hi. I'm playing around with

Hi.
I'm playing around with the simple client example in JSJaC and my problem is that every message gives me a new notification in PSI and does not continue in the same chat window.
Any hints?

Thanks!

max95

Syndicate content