[C#] HttpWebRequest not sending Cookies on Windows Phone

Had a similar problem to Jeroen Swart to do with Cookies in Windows Phone as he mentioned in his blog post here.

Basically identical C# code to make a HttpWebRequest with a few cookies would work in a simple desktop app but no cookies would be sent at all in Windows Phone.

My code to add cookies to a CookieContainer:

cookies.Add(new Uri("https://alexanderhoughton.co.uk/"), new Cookie("TestCookie", "TestCookieValue", "/", "alexanderhoughton.co.uk"));

The fix was to remove the path and domain strings from the Cookie constructor! As Jeroen mentioned in his blog, it’s something to do with the ‘.’ prefix etc.

Working Code:

cookies.Add(new Uri("https://alexanderhoughton.co.uk/"), new Cookie("TestCookie", "TestCookieValue"));

Cookies now are sent successfully.

6 responses to “[C#] HttpWebRequest not sending Cookies on Windows Phone”

  1. Just logged into evotaya777casinologin and everything went smooth. Seems legit, worth a look for the login experience alone. You can check it out here: evotaya777casinologin

  2. Hit up gamevip88 the other day. Had a good run. Lots of options and some unique games you don’t see everywhere. Worth a look if you’re bored with the usual stuff. You can visit them here: gamevip88.

  3. 8casinocomapp. The mobile app runs pretty smooth – makes it easy to play on the run. I played some Baccarat. Give it a try. Download the app here: 8casinocomapp.

  4. Superb service and a very welcoming community. I had a small issue with my account but it was sorted in minutes. bangladeshjaya9 is truly professional.

  5. One thing I would like to discuss is that fat reduction plan fast can be achieved by the perfect diet and exercise. An individual’s size not merely affects appearance, but also the quality of life. Self-esteem, depression, health risks, as well as physical ability are damaged in putting on weight. It is possible to do everything right and still gain. If this happens, a medical problem may be the reason. While excessive food and not enough exercising are usually at fault, common medical ailments and traditionally used prescriptions might greatly amplify size. Kudos for your post right here.

Leave a Reply

Your email address will not be published. Required fields are marked *