I'm using Strophe to connect to my Openfire XMPP server. The user
fills in his JID and password and a connection is set up to my server.
I want, that it is possible to surf across the website without the
need to re-authenticate. To make this possible i found out that
strophe has a method named "attach" that makes this possible. But i'm
having problems:
first: The server responds with "invalid SID" when strophe sends the
disconnect
second: After the web page is refreshed the attach respond is "invalid
SID"
I've no idea what's the problem. the RID number is ok and the SID is
the same.
Debug data:
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 203
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277873' xmlns='
http://jabber.org/protocol/httpbind'
to='clubs' xml:lang='en' wait='60' hold='1' content='text/xml;
charset=utf-8' ver='1.6' xmpp:version='1.0'
xmlns:xmpp='urn:xmpp:xbosh'/>
HTTP/1.1 200 OK
Date: Fri, 15 Oct 2010 12:41:17 GMT
Server: Jetty(6.1.x)
Content-Type: text/xml; charset=utf-8
Content-Length: 577
Via: 1.1 localhost
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
----------------------------------------------------------
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 193
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277874' xmlns='
http://jabber.org/protocol/httpbind'
sid='5d0f8d52'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl'
mechanism='PLAIN'>anV1bEBjbHVicwBqdXVsAFZhaXIwbmVl</auth></body>
HTTP/1.1 200 OK
Date: Fri, 15 Oct 2010 12:41:17 GMT
Server: Jetty(6.1.x)
Content-Type: text/xml; charset=utf-8
Content-Length: 108
Via: 1.1 localhost
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
----------------------------------------------------------
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 156
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277875' xmlns='
http://jabber.org/protocol/httpbind'
sid='5d0f8d52' to='clubs' xml:lang='en' xmpp:restart='true'
xmlns:xmpp='urn:xmpp:xbosh'/>
HTTP/1.1 200 OK
Date: Fri, 15 Oct 2010 12:41:17 GMT
Server: Jetty(6.1.x)
Content-Type: text/xml; charset=utf-8
Content-Length: 334
Via: 1.1 localhost
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
----------------------------------------------------------
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 197
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277876' xmlns='
http://jabber.org/protocol/httpbind'
sid='5d0f8d52'><iq type='set' id='_bind_auth_2'
xmlns='jabber:client'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/
></iq></body>
HTTP/1.1 200 OK
Date: Fri, 15 Oct 2010 12:41:17 GMT
Server: Jetty(6.1.x)
Content-Type: text/xml; charset=utf-8
Content-Length: 210
Via: 1.1 localhost
Keep-Alive: timeout=5, max=97
Connection: Keep-Alive
----------------------------------------------------------
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 206
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277877' xmlns='
http://jabber.org/protocol/httpbind'
sid='5d0f8d52'><iq type='set' id='_session_auth_2'
xmlns='jabber:client'><session xmlns='urn:ietf:params:xml:ns:xmpp-
session'/></iq></body>
HTTP/1.1 200 OK
Date: Fri, 15 Oct 2010 12:41:17 GMT
Server: Jetty(6.1.x)
Content-Type: text/xml; charset=utf-8
Content-Length: 184
Via: 1.1 localhost
Keep-Alive: timeout=5, max=96
Connection: Keep-Alive
----------------------------------------------------------
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 214
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277878' xmlns='
http://jabber.org/protocol/httpbind'
sid='5d0f8d52'><iq type='get' xmlns='jabber:client'
id='8013:sendIQ'><query xmlns='jabber:iq:roster'/></iq><presence
xmlns='jabber:client'/></body>
HTTP/1.1 200 OK
Date: Fri, 15 Oct 2010 12:41:18 GMT
Server: Jetty(6.1.x)
Content-Type: text/xml; charset=utf-8
Content-Length: 159
Via: 1.1 localhost
Keep-Alive: timeout=5, max=95
Connection: Keep-Alive
----------------------------------------------------------
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 83
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277879' xmlns='
http://jabber.org/protocol/httpbind'
sid='5d0f8d52'/>
HTTP/1.1 200 OK
Date: Fri, 15 Oct 2010 12:41:40 GMT
Server: Jetty(6.1.x)
Content-Type: text/xml; charset=utf-8
Content-Length: 57
Via: 1.1 localhost
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
----------------------------------------------------------
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 83
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277880' xmlns='
http://jabber.org/protocol/httpbind'
sid='5d0f8d52'/>
HTTP/1.1 200 OK
Date: Fri, 15 Oct 2010 12:41:40 GMT
Server: Jetty(6.1.x)
Content-Type: text/xml; charset=utf-8
Content-Length: 103
Via: 1.1 localhost
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
----------------------------------------------------------
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 158
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277881' xmlns='
http://jabber.org/protocol/httpbind'
sid='5d0f8d52' type='terminate'><presence xmlns='jabber:client'
type='unavailable'/></body>
HTTP/1.1 404 Invalid SID.
Date: Fri, 15 Oct 2010 12:41:40 GMT
Server: Jetty(6.1.x)
Content-Type: text/html; charset=iso-8859-1
Content-Length: 1402
Via: 1.1 localhost
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
----------------------------------------------------------
http://www.sidproblem.com/http-bind
POST /http-bind HTTP/1.1
Host:
www.sidproblem.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.10)
Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 83
Content-Type: text/plain; charset=UTF-8
Cookie: forum_tree=forum_tree;
clubsSession2=knbn8gogq2992v7uli2bs1j0v3
Pragma: no-cache
Cache-Control: no-cache
<body rid='1964277882' xmlns='
http://jabber.org/protocol/httpbind'
sid='5d0f8d52'/>
HTTP/1.1 404 Invalid SID.
Date: Fri, 15 Oct 2010 12:41:43 GMT
Server: Jetty(6.1.x)
Content-Type: text/html; charset=iso-8859-1
Content-Length: 1402
Via: 1.1 localhost
Keep-Alive: timeout=5, max=91
Connection: Keep-Alive
----------------------------------------------------------