How to parse HttpWebResponse.Headers.Keys for a Set-Cookie session id returned

后端 未结 4 567
名媛妹妹
名媛妹妹 2020-12-13 07:46

I\'m trying to create an HttpWebRequest/HttpWebResponse session with an ASP.NET website to later parse an HTML form through url params (this part I know how to do), but I do

4条回答
  •  情歌与酒
    2020-12-13 08:02

    hum I may be wrong but from what I am observing lately

    Cookies from a first response, don't include the 'set cookie' as cookies that come in the header (for example some session id...) in the case of a 302 (redirect) status

    If the autofollowredirect is set to true, then the set cookie are processed, and the subsequent request which is done automatically, will include those cookies defined by set cookie on the first call

    If autofollowredirect is set to false then the first request doesn't get the cookies positionned by the set cookie, and I guess and this is also my queston if anyone know, that the only way to subsequently have those cookies in next request, is parse the set cookies ?

提交回复
热议问题