Http web request does not support session

I have a program where I want to give up some useful materials for study. This site also supports a session key and another key. If I try to enter a subpage, then it will throw me out and show a session message. I could not save the session key in the web request class. so please give me some idea on how I can maintain a session in the web request class.

+3
source share
3 answers

You need to support CookiesCollection according to your requests.

var request = (HttpWebRequest)HttpWebRequest.Create("http://www.mysite.com/");
var cookies = new CookieContainer();

//Pass the collection along with each request to maintain session
request.CookieContainer = cookies;

, cookie. .

+8

, , . , , .

0

iFrame. - ( IE8). , ? Google P3P, .

-sa

0

Source: https://habr.com/ru/post/1737223/


All Articles