       return parsedRpc(sessionContext, rpc, parseWarnings) if sessionContext
 
       if rpc.cpeRequest?.name isnt 'Inform'
-        msg = {
+        logger.accessError({
           message: 'Invalid session'
-          sessionContext: sessionContext or {}
-        }
-        msg.sessionContext.httpRequest = httpRequest
-        msg.sessionContext.httpResponse = httpResponse
-        logger.accessError(msg)
+          sessionContext: sessionContext or {httpRequest: httpRequest, httpResponse: httpResponse}
+        })
         httpResponse.writeHead(400, {'Connection': 'close'})
         httpResponse.end('Invalid session')
         stats.concurrentRequests -= 1

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

      if sessionContext and (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

      # Check again just in case device included old session ID from the previous session
      if not sessionContext and stats.concurrentRequests > MAX_CONCURRENT_REQUESTS
        httpResponse.writeHead(503, {'Retry-after': 60, 'Connection': 'close'})
        httpResponse.end('503 Service Unavailable')
        stats.droppedRequests += 1

    )

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