I have this function to recover response files in CookieContainer (this.cookies)
private void getCookies(string url) { // request HttpWebRequest request = CreateWebRequestObject(url); request.CookieContainer = this.cookies; request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Language", " es-MX,es;q=0.8,en-us;q=0.5,en;q=0.3"); request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Method = "GET"; request.UserAgent = "Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2"; // response using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { foreach (Cookie c in response.Cookies) { this.cookies.Add(new Cookie(c.Name, c.Value, c.Path, c.Domain)); } } }
But when I debug the request in Fiddler, I get the following:

Why do cookies have "$"?
According to MSDN
public cookie (string name, string value, string path, domain string)
Name Type: System.String Name of the cookie. The following characters should not be used inside the name: equal sign, semicolon, comma, new line (\ n), return (\ r), tab (\ t) and space character. The dollar sign ("$") cannot be the first character.
How to remove this character?
auraham
source share