C
cmklar
I'm working on a spider, which has to crawl a certain site, one of the
cookie they are sending down contains some commas in the cookie value
part, and this seems to make trouble while coding in dotnet.
I'm having difficulties in both directions; when getting the cookie
down dotnet splits it to multiple cookies (as if the comma would be the
cookie delimiter).
and when trying to send back up such a cookie it will throw an
exception on the following line:
Request.CookieContainer.Add(new Cookie("A","some,commas","/",
"www.mysite.com"));
Exception="The 'Value'=some,commas' part of the Cookie is invalid."
Regardless of what the RFC dictates if this site is using it and it
works on all major browsers (tried IE & FireFox) there should be a way
to do it in dotnet.
so on the way down i overcame it by manually parsing the "Set-Cookie"
header.
but I'm lost on how to send it back up!!
trying to set the Request.Headers["Cookie"] troughs an exception.
setting the Request.CookieContainer also throws an exception.
so how can i attach this value??
cookie they are sending down contains some commas in the cookie value
part, and this seems to make trouble while coding in dotnet.
I'm having difficulties in both directions; when getting the cookie
down dotnet splits it to multiple cookies (as if the comma would be the
cookie delimiter).
and when trying to send back up such a cookie it will throw an
exception on the following line:
Request.CookieContainer.Add(new Cookie("A","some,commas","/",
"www.mysite.com"));
Exception="The 'Value'=some,commas' part of the Cookie is invalid."
Regardless of what the RFC dictates if this site is using it and it
works on all major browsers (tried IE & FireFox) there should be a way
to do it in dotnet.
so on the way down i overcame it by manually parsing the "Set-Cookie"
header.
but I'm lost on how to send it back up!!
trying to set the Request.Headers["Cookie"] troughs an exception.
setting the Request.CookieContainer also throws an exception.
so how can i attach this value??