 
         @open = ->
             stdOpen.apply @, arguments
-            header = jar.authCookie
-            @setRequestHeader 'cookie', header
+            @setRequestHeader 'cookie', jar.cookies.join('; ')
         @
 
 helpers.patchSocketIO = ->

            Socket = global.MozWebSocket or global.WebSocket

        url = @prepareUrl() + query
        @websocket = new Socket url, headers: 'Cookie': jar.authCookie

        @websocket.onopen = ->
            self.onOpen()

    client = helpers.getClient()
    client.post 'login', password: password, (err, res) =>
        if res.headers['set-cookie']
            @jar.cookies = res.headers["set-cookie"].map (cookie) ->
                cookie.split(';')[0]
        done()

helpers.createAllRequests = (done) ->
