How do you get a BOSH session id from PHP?

Yeah… I tried XMPPHP it epic failed because it wouldn’t auth. So, I’m completely clueless on what to do. I have a bunch of registered users and I need to be able to connect from javascript after logging in. So, any tips? Anything that works, I will try. Pretty desperate here.