     currentRequest = {
       httpRequest : httpRequest
       httpResponse : httpResponse
-      deviceId : cwmpRequest.cookies?.deviceId
     }
+
+    if cwmpRequest.methodRequest?.deviceId?
+      currentRequest.deviceId = common.getDeviceId(cwmpRequest.methodRequest.deviceId)
+    else
+      currentRequest.deviceId = cwmpRequest.cookies.deviceId
 
     if config.DEBUG_DEVICES[currentRequest.deviceId]
       dump = "# REQUEST #{new Date(Date.now())}\n" + JSON.stringify(httpRequest.headers) + "\n#{httpRequest.getBody()}\n\n"

        for k of reference
          continue if k[0] == '_'
          if not actual[k]?._timestamp? or actual[k]._timestamp < lastBootstrap
            _tasks.push({device: deviceId, name : 'refreshObject', objectName : reference[k]._path})
          else
            traverse(reference[k], actual[k])


        path += p + '.'
        projection[path + '_timestamp'] = 1

    db.devicesCollection.findOne({'_id' : currentRequest.deviceId}, projection, (err, device) ->
      throw err if err
      lastBootstrap ?= device?._lastBootstrap
      _tasks = []
