HttpWebResponse POST Request not returning all the cookies

DeusOmnis

Newcomer
Joined
Jan 1, 2004
Messages
2
I'm trying to send a POST to a website and I need the cookies it's suppose to return, however, it's not returning all the cookies I need. If I do it with my browser I get seven cookies, if I do it with the ASP.NET post I get 2. I've read the headers to make sure .NET just isnt taking all of the cookies out, and there's definately not more than 2. I've tried searching everywhere on the net for similar issues and I'm all run out of ideas for what to try next. Has anyone any ideas?
 
I solved my problem, but I have another question too. I figured out that there was an auto redirect from the page I posted to to another page. By disallowing the redirect using the HttpWebRequest.AllowAutoRedirect property I was able to grab the cookies that I needed. However, does anyone know how to grab the cookies both from before teh redirect and after? Or is there not a way?
 
Did you try creating two separate cookie containers and then switching them before the redirect takes place?
 
Back
Top