You can store the BOSH 'sid' and 'rid' values, either locally or on the server, and re-attach to the connection from the new page.
An overview of doing with Strophe.js is described in this article: Getting attached to Strophe. Other libraries will likely have similar mechanisms, as this is a common BOSH technique.