Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8931757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:10:50+00:00 2026-06-15T09:10:50+00:00

I am trying to pre-bind an XMPP session via XMPHP and pass the rid/sid/jid

  • 0

I am trying to pre-bind an XMPP session via XMPHP and pass the rid/sid/jid to a strophe client to attach to the session.

connection code here:

$conn = new CIRCUIT_BOSH('server.com', 7070, $username, $pass, $resource, 'server.com', $printlog=true, $loglevel=XMPPHP_Log::LEVEL_VERBOSE);
$conn->autoSubscribe();

try{
  $conn->connect('http://xmpp.server.com/http-bind', 1, true);
  $log->lwrite('Connected!');
}catch(XMPPHP_Exception $e){
  die($e->getMessage());
}

I am getting the rid and sid but the fulljid in the $conn object stays empty and I cant see a session started on my openfire admin console.

If I create the jid manually by using the given resource and passing jid/rid/sid to strophe to use in attach, I get the ATTACHED status and I see calls from the client to the BOSH ip but I still dont see a session and I cant use the connection.

Strophe Client Code:

Called on document ready:

var sid = $.cookie('sid');
var rid = $.cookie('rid');
var jid = $.cookie('jid');
    $(document).trigger('attach', {
      sid: sid,
      rid: rid,
      jid: jid,
    });

$(document).bind('attach', function (ev, data) {

    var conn = new Strophe.Connection(
        "http://xmpp.server.com/http-bind");

    conn.attach(data.jid, data.sid, data.rid, function (status) {
        if (status === Strophe.Status.CONNECTED) {
            $(document).trigger('connected');
        } else if (status === Strophe.Status.DISCONNECTED) {
            $(document).trigger('disconnected');
        } else if (status === Strophe.Status.ATTACHED){
            $(document).trigger('attached');
        }
    });

    Object.connection = conn;

}); 

I think the problem starts on the XMPPHP side which is not creating the session properly.
‘attached’ is triggered but never ‘connected’, is status ‘connected’ supposed to be sent?
What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:10:51+00:00Added an answer on June 15, 2026 at 9:10 am

    Ok, solved, I saw that XMPPHP lib didn’t create a session at all on the openfire server, so I wrote a simple test for the XMPP class which was good and created the session, and for the XMPP_BOSH class that didn’t manage create one. Then I saw the issue report here: http://code.google.com/p/xmpphp/issues/detail?id=47 comment no.9 worked, it fixed the issue by copying the processUntil() function from the XMLStream.php to BOSH.php, still can’t figure out why this is working. Then I found I had an overlapping bug also with some of the passwords set for users on the openfire server. These passwords contained these ! # % ^ characters, for some reason the XMPP_BOSH is sending the password corrupted or changed so I got Auth Failed exception. Changing the password fixed the issue and I can now attach to the session XMPPHP created with the Strophe.js library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pre-populate create defect popup and I'm not clear on what key/values
I'm trying to get pre/post annotations working with a web application, but for some
I am trying to convert some pre-existing html/JavaScript files to Flex. I tried making
I am trying to copy my pre-populated database to a writable directory (I am
I'm trying to match expressions that start with PRE and end with PRE. I'm
I'm trying to use ThreadLocal to provide thread safety to pre-existing non-thread-safe classes, but
I am trying to figure out a way to pre-process few things before my
I am trying to display a Dialog with an EditText field, pre-populate the EditText
Please help me, I'm trying to find some documentation about pre-installed applications at Android.
I am trying to pre-populate data to a token input field. But nothing gets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.