there are many questions similar to this, but none of them helped me. I mainly use the WSGI start_response () method. I tried to set the dummy header in the response with the tuple [("Set-Cookie", "token = THE_TOKEN")] and add it to start the response as follows:
status = '200 OK' response = 'Success' start_response(status,[('Set-Cookie', "DMR_TOKEN=DMR_TOKEN")]) return response
I'm not sure if it works correctly, but here is the setting for cookies . Now let's assume that the header is correct, and in the following queries I want to authenticate the token. What would be the correct way to catch this cookie / header set in the past?
I read and found that I need something like this:
(environ.get("HTTP_COOKIE",""))
but this all the time gave an empty string, so I just assume that the header / cookie is set incorrectly.
Thanks guys,
source share