     )
 
     parsedRpc = (sessionContext, rpc, parseWarnings) ->
-      sessionContext.httpRequest = httpRequest
-      sessionContext.httpResponse = httpResponse
-
       for w in parseWarnings
         w.sessionContext = sessionContext
         w.rpc = rpc;

      return session.init(deviceId, rpc.cwmpVersion, rpc.sessionTimeout ? config.get('SESSION_TIMEOUT', deviceId), (err, sessionContext) ->
        return throwError(err, httpResponse) if err

        sessionContext.sessionId = crypto.randomBytes(8).toString('hex')
        httpRequest.connection.setTimeout(sessionContext.timeout * 1000)


    getSession(httpRequest.connection, sessionId, (err, sessionContext) ->
      return throwError(err, httpResponse) if err

      if sessionContext
        sessionContext.httpRequest = httpRequest
        sessionContext.httpResponse = httpResponse

        if sessionContext.sessionId != sessionId or
            sessionContext.lastActivity + sessionContext.timeout * 1000 < Date.now()
          logger.accessError({message: 'Invalid session', sessionContext: sessionContext})
          httpResponse.writeHead(400, {'Connection': 'close'})
          httpResponse.end('Invalid session')
          stats.concurrentRequests -= 1
          return
      else if stats.concurrentRequests > MAX_CONCURRENT_REQUESTS
        # Check again just in case device included old session ID from the previous session
        httpResponse.writeHead(503, {'Retry-after': 60, 'Connection': 'close'})
        httpResponse.end('503 Service Unavailable')
        stats.droppedRequests += 1
