Crawling issue: nbHits 0 when CustomDownloaderMiddleware is attached with auth-cookie

My websites needs authentication to crawl through the pages.

DOWNLOADER_MIDDLEWARES_PATH = root_module + 'custom_downloader_middleware.' + CustomDownloaderMiddleware.__name__


if os.getenv('AUTH_COOKIE_NAME') and os.getenv('AUTH_COOKIE_VALUE'):
        auth_cookie = {
            'name': os.getenv('AUTH_COOKIE_NAME'),
            'value': os.getenv('AUTH_COOKIE_VALUE'),
        CustomDownloaderMiddleware.auth_cookie = auth_cookie

This was working properly but after some updates, it started returning the Crawling issue: nbHits 0.

Can anyone help on this?