Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Doesn't save sid #17

Open
xDaizu opened this issue May 12, 2015 · 3 comments
Open

Doesn't save sid #17

xDaizu opened this issue May 12, 2015 · 3 comments

Comments

@xDaizu
Copy link

xDaizu commented May 12, 2015

If I understand the protocol correctly, $sid should be somehow persisted so it doesn't create a new sid for the same user every time you call the binding.php file.

Well, I followed your example (adding $username and $password variables and an echo at the end)

require_once "lib/XmppPrebind.php";


$username = "test";
$password = "test";

$xmppPrebind = new XmppPrebind('localhost', 'http://localhost:5280/http-bind/', null, false, true);
$xmppPrebind->connect($username, $password);
$xmppPrebind->auth();
$sessionInfo = $xmppPrebind->getSessionInfo(); // array containing sid, rid and jid

echo json_encode($sessionInfo);

and every time I run it, it gives me a different sid. Where is it supposed to save it? And, if it doesn't, (i could save it myself) how do I inject it back in the next run?

@matthieuy
Copy link

Same problem here. I try save sid in $_SESSION and return it with an another rid but it don't work !

@xDaizu
Copy link
Author

xDaizu commented May 15, 2015

I'm starting to think you can't save the sid by design, so you have to do it through JavaScript so it can give suppor to different sids for different chat tabs in the same browser.

@matthieuy
Copy link

@xDaizu : that's right, i save sid, rid and jid in $_COOKIE.
In your javascript code (eg : StropheJS), you load values without prebind

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants