Question

I have a VB.NET app that sends a POST request to a script on my server that is running Cloudflare. I always get an error when sending the request from the app, however using a Firefox extension to simulate the request works fine. With the use of Fiddler I think I have found the cause of the problem:

When sending the request with the Firefox addon an extra header is attached to the request:

Cookie: __cfduidxxxxxxxxxxxx

This cookie is from Cloudflare, but where does it come from, ie. how can I get this cookie value and send it with my requests from the VB app? I tried copying and pasting the cookie into the app and it worked fine, so this leads me to conclude that I need this cookie, however this value is unique for each user so I cannot simply hardcode it into the app.

Quick side-note: Not sure if this helps, but if I send a GET request from the VB app it works fine without the __cfduid cookie.

Was it helpful?

Solution

Look for a Set-Cookie header coming back from the server on it's response. It will expect to get that value back on subsequent requests in a Cookie: header. This value is usually an opaque string that is classified by a path, although not always.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top