HttpWebRequest/HttpWebResponse Cookie Problem

  • Thread starter Thread starter hyu1337
  • Start date Start date
H

hyu1337

I've being trying to get a cookie value for a certain site but the
site I have no control over has a comma (",") in the cookie value
and it gets broken down like this when I use the response=
(HttpWebRequest)request.GetResponse.

Name: SESSION_ID Value: 3862511
Name:
y90iM7ucrhW/nFEi8nxHdslJniTZTOGlLgL0zEVrSiFlc8WKvP8Q3GIaaNmz/XCZ
Value: Path: /

When the actual cookie should be
Name: Session_ID
Value =
3862511,y90iM7ucrhW/nFEi8nxHdslJniTZTOGlLgL0zEVrSiFlc8WKvP8Q3GIaaNmz
/XCZ

Is there a way to fix this? Or am I out of luck? Thanks.
 
.NET is processing this correctly and unfortunately the website is wrong
in sending this value. The standard says that commas should not be used in
cookie values (along with semi-colons, and spaces, I believe).

You will have to take the two values for the SESSION_ID cookie and
append the comma into it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top