79109058

Date: 2024-10-21 07:58:20
Score: 1.5
Natty:
Report link

More secure cookies with Django >= 4.2:

# set cookie with **Request**:
request.get_signed_cookie("name")

# get cookie with **Response**:
response = render(request, "index.html")
response.set_signed_cookie("name", "value")
return response

refer: https://docs.djangoproject.com/en/5.1/ref/request-response/#django.http.HttpResponse.set_cookie

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: KhacNha