I'm trying to send a cookie with a request to an Asp.net page. From what I understand it expects the cookies value to NOT be encoded. If I encode the value it doesn't register it.
CookieContainer
won't let me add the non encoded value to it though. I can't seem to find a work around...
My code is essentially
HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(@"http:\\whatever");
string cookieName = "whatevername";
string cookieValue = "version=1&Type=a,b,c,d,e,f";
Cookie cook = new Cookie(cookieName, cookieValue, "/", "mypage");
CookieContainer cookies = new CookieContainer();
cookies.Add(cook);
request.CookieContainer = cookies;
This throws a CookieException saying "The 'Value'='version=1&Type=a,b,c,d,e,f' part of the cookie is invalid.
"