BOSH connection with PHP

I am currently using strophe to connect with the BOSH client, i am looking at a way to make a BOSH connection via PHP backend so that i can store the JID, SID and RID for the session that can be used across browser pages.

Currently a new connection is initiated whenever the page refreshes, i also tried the same with Strophe storing these values in a cookie but the attach always fails with Invalid SID.

I tried searching on the net but could not find anything related to PHP.

Regards,

Sheldon