Answer the question
In order to leave comments, you need to log in
Django set cookie?
From the front :8080 I send a request to django :8000, in the response I try to create a cookie
from rest_framework.response import Response
def post(self,request):
response = Response({"users": serializer.data})
response.set_cookie(key='api_token', value=12,max_age=30, domain='127.0.0.1', secure=False, httponly=True,samesite='None')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question