Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
CSS
I try to login one website using C# HTTPWebRequest class, i can login but not able to read multiple set-cookies in header

When the server responds with multiple "Set-Cookie:"-headers, only the first one becomes available to me in header

Web Response in HTTPWebRequest

    Set-Cookie: x-main=Yvi4723B?Nk5zuPPCZ0?66eGEI5kVnOM; path=/; domain=.xxx.com;
expires=Wed May 25 13:20:05 2011 GMT
How to get all "Set-Cookie:" in header using HTTPWebRequest class??

Web Response in HTTP Live Header

    Set-Cookie: crstoken=Yvi4723B?Nk5zuPPCZ0?66eGEI5kVnOM; path=/; domain=.xxxx.com; expires=Wed May 25 13:20:05 2011 GMT

    Set-Cookie: Sessionid=sfdsffsdf bsfdfdsfdsfs; path=/; domain=.xxx.com; expires=Wed May 25 13:20:05 2011 GMT

   I need to get crstoken and Sessionid from Set-Cookie.

I am looking forward your reply,

Thanks in advance.......
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900