cookies are not being set django dont know why

Good afternoon i will continue here my old post, I have a small problem, I have 2 different functions and then I can share them, but in my code what is happening is that one of these lines of code works, and the other doesn’t, and I really wanted to know why , because I wanted to insert a uuid in the cookies, but it didn’t, just another way, here it goes:

something like, this one works:
response.set_cookie('user_uuid', str(face_recognition.uuid))

but this one no response.set_cookie('user_uuid', str(cookie_uuid))

why ? no idea, they have the same value and the same name, one insert , and the other one no

the code that doesn’t work

def unique_identifier(request):
    print("unique identifier function called...")
    response = HttpResponse("Cookie Set")
    cookie_uuid = uuid.uuid4() # Create a UUID
    response.set_cookie('user_uuid', str(cookie_uuid))
    print("UUID defined in the user's cookies:", cookie_uuid)
    return response

debug:

No UUID found in user cookies
created a new UUID.
unique identifier function called...
UUID defined in user cookies: 5abb1b89-1ded-4fec-849d-567a9fb12d92
<django.contrib.sessions.backends.signed_cookies.SessionStore object at 0x000001A860C7BA50>
Session key: None
[22/May/2024 12:35:02] "GET / HTTP/1.1" 200 2373

the code that work

@csrf_exempt
def process_frame(request):
    print("Processando frame...")
    if request.method == 'POST':
        frame_data = request.POST.get('frame_data')
        frame_data = frame_data.split(',')[1]  # Remover o prefixo 'data:image/png;base64,'
        frame_data = base64.b64decode(frame_data)
        frame_data = np.frombuffer(frame_data, dtype=np.uint8)
        frame = cv2.imdecode(frame_data, flags=1)

        cv2.imwrite('frames/CurrentFrame.jpg', frame)
        
        # Agora você pode passar o frame para a função compare_faces()
        result = compare_faces(request, frame)
        print("result:", result)
        if result == None:
            response = JsonResponse({'error': 'Utilizador não encontrado crie um rosto'}, status=400)
        elif isinstance(result, HttpResponseRedirect):
            response = JsonResponse({'message': 'redirecionamento', 'url': result.url})
        else:
            response = JsonResponse({'message': result})

        # Se um UUID foi gerado, defina-o no cookie da resposta
        face_recognition = FaceRecognition(request)
        if face_recognition.uuid is not None:
            print("UUID gerado no processar frame:", face_recognition.uuid)
            response.set_cookie('user_uuid', str(face_recognition.uuid))
            print("Cookies definidos na resposta user_uuid:", response.cookies)

        print("response:", response)
        return response
    else:
        return JsonResponse({'message': 'Método não permitido'}, status=405)

debug

UUID gerado no processar frame: 9cfabec5-7409-421d-8e6b-f33f24eef7a5
Cookies definidos na resposta user_uuid: Set-Cookie: user_uuid=9cfabec5-7409-421d-8e6b-f33f24eef7a5; Path=/

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật