powered by Jive Software

Losing session in another window

Hi guys,

I’'m working in a simple flash messenger based in XIFF Lib (last version).

When i connect in the server i receive my list of friends. If a user is online i can start a chat session with this users clicking in his name.

After click i open a pop-up sending parameters like myUser, myPass and friend name. In this new window i lost my session. If a check the sessions in the server, my connection is lost.

Question:[/b] If i is logged as a user, i can open a new window with the same user? Or i need use the same flash API to log in and chat?

Tks a lot.

Message was edited by:


Are you opening a new browser window? That won’'t work unless you do something with LocalConnection (never tried this - not sure how to architect it but it might be possible).

When you reconnect in your new window the server will boot you off your old connection if you use the same setting for “resource” in your JID. I’‘m guessing this is what is happening to you. You could change the resource setting, but then you’‘ll have two open connections, which works, but probably isn’'t the best way to go about doing things.

I’'d look into using LocalConnection to send data from the SWF that has your roster (and the XMPPConnection class) to the SWF that has the chat window, and vice-versa.

Tks a lot

I’'m working on a project right now doing exactly this.

To cut a long story short you can use localConnection to transmit the XMPP Messages between browser windows (as an XML string).

We’‘ve got a central messenger app which pops up new windows for IM’'s, Conferencing and Subscription requests. It forwards/receives XMPP Stanzas between the server and the windows.

All in all a very fiddly and difficult job!

Yes, Macromedia Central was a much better environment for doing this type of thing, with automatic synchronization and shared data providers between windows. Unfortunately, Central never really took off.

I’'d never heard of Central until I read your reply.

I’'ve had a look at it on the macromedia website. Has been it been discontinued do you know?

No, it’‘s not discontinued. Just seems to have lost steam with the developer community. I don’'t think MM will abandon it (at least I hope not), but it might find different form in future generations. Definitely the easiest way to build a full instant messenger with XIFF is to use Central (I know - I did it with Central 1.0 before the move to ActionScript 2.0 and XIFF 2.0).

The only problem is that this forces your users to install Central (instead of a pure browser-based solution).