title: Having trouble attaching to a BOSH session using Strophe
body: <p>I'm implementing a real-time notification system using XMPP over BOSH and Strophe on the client-side, but I'm having some problems. When I log onto my website I establish a BOSH connection in back-end and save JID, SID and RID as cookies. When the page is reloaded I get the data from the cookies and attach to that session using Strophe's attach function. I get a callback status which says I've been attached. </p>
  
  <p>The first problem I'm facing is that requests are being sent every second second or so. 
  These are the request headers:</p>
  
  <blockquote>
    <p>Request URL:http://localhost:7070/http-bind/<br>
    Request Method:POST<br>
    Status Code:200 OK  </p>
    
    <p><strong>Request Headers</strong><br>
    Accept: */*<br>
    Accept-Charset:UTF-8,*;q=0.5<br>
    Accept-Encoding:gzip,deflate,sdch<br>
    Accept-Language:sv-SE,sv;q=0.8,en-US;q=0.6,en;q=0.4<br>
    Cache-Control:max-age=0<br>
    Connection:keep-alive<br>
    Content-Length:77<br>
    Cookie:JSESSIONID=ibxwvm3ophp8; jiveforums.admin.logviewer="debug.size=0&amp;info.size=0&amp;warn.size=0&amp;error.size=0"<br>
    Host:localhost:7070<br>
    Origin:http://<strong><em>*</em>**</strong><br>
    Referer:http://<strong><em>*</em>**</strong>/flXHR/flXHR.swf<br>
    User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.107 Safari/535.1
    content-type:application/x-www-form-urlencoded  </p>
    
    <p><strong>Form Data</strong><br>
    &lt; body rid:'3007' xmlns  </p>
    
    <p><strong>Response Headers</strong><br>
    Content-Length:57<br>
    Content-Type:text/xml;charset=UTF-8<br>
    Server:Jetty(7.0.2-SNAPSHOT)</p>
  </blockquote>
  
  <p>I can't see any response content so I'm not sure what's causing it. The form data being sent looks like invalid and incomplete XML, is this what causes it or is that just how Chrome would format it in the debugger?</p>
  
  <p>The other problem I'm facing is when I reload the page. I've bound an unload event to the window object in which I increase the RID by one and save it to the cookie. However, when the page is reloaded it says that I've attached to the BOSH session but then I get the following error message:</p>
  
  <blockquote>
    <p><code>POST <a href="http://localhost:7070/http-bind/" rel="nofollow">http://localhost:7070/http-bind/</a> 404 (Not Found) (localhost)</code>  </p>
    
    <p><code>Uncaught Error: 16, ioError, An error occured preventing completion of the request. (flensed.js)</code></p>
  </blockquote>
  
  <p>The next request will throw 404 (Invalid SID.) instead of 404 (Not Found) and repeats every 70+ seconds or so.</p>
  
  <p>Has anyone else gotten this problem and know how to solve it? I'm frustrated!</p>
  
  <p>Thanks in advance,<br>
  Pierre</p>